Associate X11 applications with filename extensions

May 16, '03 09:27:00AM

Contributed by: KOHb

I like using gv(ghostview, available from Fink) as my PostScript viewer. Unfortunately, you can't choose /sw/bin/gv in the Get Info -> Open With -> Other dialog. To get around this, you can use DropScript! Create a script like so (gv.open)

#!/bin/sh

PATH=/sw/bin:/sw/sbin:/usr/bin:/bin
/usr/bin/open -a X11

for file in $@
do
  gv $file
done
When you open this script with DropScript, it will create an application called "Dropgv." Then you can use this as the Open With application. The PATH line is necessary because /sw/bin isn't in the default path. As gvgs, writing /sw/bin/gv won't work. The open line will open X11 if it's not already open.

Comments (20)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030514163941559