Update (2010): this is no longer necessary in Snow Leopard, as X11 starts automatically when you need it, i.e. by typing “gv idl.ps” in the Terminal.
DropScript is a handy tool that allows you to create normal OSX applications from scripts written your favorite scripting language. This becomes even more useful with the X11 updates to Leopard, since any application that needs X11 will launch it itself.
For an example, even though opening PostScript files with Preview is refreshingly simple, the required conversion to PDF takes just a little bit too long if you’re used to the speed of gv. Well, now you can make an application that automatically opens gv if you drop PostScript files onto it (or configure it as the default application). Here’s how to do it (via R. Lupton):
- Download DropScript and unpack it.
- Make a text file named “gv.sh” with the following shell script. Note that you need the directory where gv lives to be included in your PATH. Mine is in /sw/bin. Run which gv and adjust the lines in the script accordingly.
- Drop the “gv.sh” file you just made on the DropScript.app.
That’s it. Now you have an application named “Dropgv” that will pop open gv when you drop a PostScript file onto it.
P.S. While you’re at it, install the EPS QuickLook plugin that will provide instant previews of PostScript files in Mail, for example.