Another way to create Finder-clickable shell scripts

Jul 30, '03 10:21:00AM

Contributed by: GaelicWizard

Want to make a double clickable shell script? Don't want to use some convoluted app that works most of the time? Don't have time to find one that you like? Make a shell script, then try this instead:

SetFile -t APPL someScript.sh 
Ta da! Suddenly the script is double-clickable in the Finder! Remember that it will always be run as if it were in the root of the disk, so always use absolute paths! You'll need the Dev Tools installed to do this, as Setfile is in /Developer/Tools. You can make a custom icon by pasting one into the Get Info window for the script in Finder.

For those of you who care, this works by setting the Type code (the resource that the Finder looks at to check if something is an application) to APPL, which indicates that it's an application. You can also set the creator code if you like with the -c option, but it's useless. Enjoy!

[robg adds: We showed another easy way of doing this in an earlier hint...]

Comments (30)


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