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


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: 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 | # ]