| Matt McIrvin
|
6
|
 |
|
11-08-2002 08:12 PM ET (US)
|
|
Until recently, I hadn't done much with AppleScript for several years. (The original reason I messed with it was that in System 7.x days, I didn't have a launcher/dock/control mechanism that I really liked, so I used speech recognition to control many things, which required writing little AppleScripts to do anything nontrivial. It was clumsy but futuristic.)
OS X has actually gotten me interested in AppleScript again, just because the Unix shell integration makes it possible to activate a Unix application or command via an AppleScript droplet that can take dropped file arguments. This in turn allows all manner of Unix/Mac integration, such as the ability to activate GIMP as an opener for picture files.
My latest trick was to use the ps2pdf command-line utility installed as part of GhostScript as a means of viewing PostScript language files with Preview or Acrobat Reader (whichever is your default viewer for PDFs):
on open input_file do shell script "export PATH=\"$PATH\":/sw/bin;ps2pdf \"" & POSIX path of input_file & "\" ~/.psview.tmp.pdf; open ~/.psview.tmp.pdf" end open
If you've got GhostScript, you can save this as an application in Script Editor, use it as the opener for .ps files, and then PostScript becomes double-clickable.
|