|
|
Another way to create Finder-clickable shell scripts
There's a better way.
Another way to create Finder-clickable shell scripts
I tried this one, cause I like it better than the previous hint -- I can add a nice icon and other frills! -- but this failed for me... The Finder decided that my foo.app was a Classic App, but didn't bring up the Classic Environment. My script is woefully simple -- it simply calls a Terminal-based executable -- which now launched in the background, with no user interaction... So I'll stick to the following, as in the older hint, for now -- just change your foo.sh
to foo.command
and presto -- auto-launch of the Terminal, and auto-run of the script therein, complete with user interaction. ---
Another way to create Finder-clickable shell scripts
You also have to create a file foo.app/Contents/Info.plist containing keys identifying the name of the executable. In this exampe, it would contain:
Another way to create Finder-clickable shell scripts
Nope. You don't actually have to do this.
Another way to create Finder-clickable shell scripts
Neat hint! But to make it work, I had to make an Info.plist file in the bundle, which must contain the usual xml headers plus the following key at minimum: <key>CFBundleExecutable</key> <string>foo</string> Apple's developer documentation about keys used in the bundles instruct not to use a file name extension for the actual program -- and after dropping the extension the shell script shows as an application inside the bundle too. I have been looking for a way to make a "droplet" from shell script, so I could drop files into the shell script which would get the dropped files as arguments. Editing the CFBundleDocumentTypes key in Info.plist didn't seem to achieve this. Does anyone know how this could be done? This might be a great way to package Python programs too!
AppleScript droplets
I use applescript to accomplish this. Something along the lines of:
on open myList repeat for each myItem do shell script "PathToMyShellScript" & " " & myItem end repeat end openThe code may be a little off, as I'm doing this for memory, but the idea works. I use it in my UnButton app, which you can get the source code for at http://www.freefallsoftware.com/products.html --- |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|