Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: Use the Finder to launch Unix apps UNIX
On Panther, you can click on the Finder icon of a Unix program to launch it:
  • If it is a "terminal" program, it will first launch Terminal
  • If it is an X11 program, it will first lanch X11.
Nice, isn't it ?
    •    
  • Currently 2.14 / 5
  You rated: 3 / 5 (7 votes cast)
 
[12,784 views]  

10.3: Use the Finder to launch Unix apps | 5 comments | Create New Account
Click here to return to the '10.3: Use the Finder to launch Unix apps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Another Option
Authored by: jbc on Feb 06, '04 12:52:33PM

For quite some time after upgrading to OS X, I was baffled why no one ever mentioned the fact that you could cause shell scripts to simply run terminal-free with a double-click in the Finder by binding it to the Launcher app in the Utilities folder using Get Info. Later discovered that this app had not been installed by Apple, but rather by the Tcl/TkAqua Batteries Included package. It's available separately here:

http://www.maths.mq.edu.au/~steffen/tcltk/Launcher/

Nice addition to the Panther features mentioned above if you run a lot of shell or perl scripts. Usually just run my shell scripts from Dragthing now.



[ Reply to This | # ]
Don't forget the Script Menu
Authored by: gatorparrots on Feb 06, '04 02:32:44PM

>"Nice addition to the Panther features mentioned above if you run a lot of shell or perl scripts. Usually just run my shell scripts from Dragthing now."

The Script Menu.menu works quite well, too. Very unintrusive and is easily accessible from any application.



[ Reply to This | # ]
10.3: Use the Finder to launch Unix apps
Authored by: rv8 on Feb 06, '04 01:07:32PM

There must be another variable at play, because this does not work correctly in all cases for me. For, example, I use Fink, and if I go into /sw/bin, clicking on gnumeric works properly, but clicking on bluefish tries to open it using the Terminal instead of X11, and clicking on abiword gets me the dialog box saying that there is on default application to open it.

What am I missing?

---
Kevin Horton



[ Reply to This | # ]
10.3: Use the Finder to launch Unix apps
Authored by: Tom Robinson on Feb 09, '04 01:53:53AM

My guess is the smarts are something along the lines of 'does it have an empty type and creator and the Unix execute bit is set', so you could check those things...



[ Reply to This | # ]
10.3: Use the Finder to launch Unix apps
Authored by: Tsuki_yomi on Feb 24, '04 02:45:53AM
Another solution is to make a shell script and put it inside the same directory structure that Apple uses.

Create a directory "SomeProg.app".
Inside this create a directory "Contents".
Inside "Contents" create a directory "MacOS". This is where you put the executable shell script.

If you want SomeProg.app to have a proper icon that can be done as well but gets a little complicated.
Inside "Contents" create another directory "Resources" This is where you put the icon you want to use. I was using this for a bookmarks sync script so I just grabbed the Mozilla icon from Mozilla.app.

You will need to add a couple of files into SomeProg.app/Contents.
Info.plist - which tells the finder the details about the program, like its version and its icon.
PkgInfo - which again tells the finder that it is an application and should be run rather than opened.

Heres my Info.plist:

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>CFBundleExecutable</key>
        <string>MozSync</string>
        <key>CFBundleIconFile</key>
        <string>mozsync.icns</string>
        <key>CFBundleIdentifier</key>
        <string>Bodgie Software</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>MozSync</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>0.50</string>
        <key>CFBundleSignature</key>
        <string>ROFLMAO</string>
        <key>CFBundleVersion</key>
        <string>0.50</string>
</dict>
</plist>
My PkgInfo (8bytes only):

APPL????

This setup is enough to completely fool the finder into thinking that its a full application, it also lets you run your own scripts from the Dock as well. If you get lost at all, use the terminal to look around the insides of some apps, thats what I did.
Some of the keys in Info.plist may not be needed but it works none the less.

Hope this helps.

[ Reply to This | # ]