I've got a bash script, potentially many of them in fact, which I'd like to be able to open files in OSX's finder with.
It's a really, really simple concept but for some reason bash scripts are greyed out in the finder 'open with' dialog.
I gather that there are various ways of using applescript or packaging as an app... but I haven't been able to figure any of this out and I don't really want to have to pick up another language just for this trivial task - could someone spoon feed me how to do this?
Thanks!
Answer
It's not possible. Launch Services works with application identifiers, and bash scripts don't have them.
You need to create a wrapper application using Automator.
- Launch Automator
- Select Application
- Look for the Run Shell Script action and add it to the right.
- Pass input as arguments
- Put your script in there
- Save somewhere
Here's my version, using the Growl command line utility:
Result:
You can see the effect this change has on ~/Library/Preferences/com.apple.LaunchServices.plist
when you Change All:
("Test" is the name I gave my Automator application)
No comments:
Post a Comment