OSX 'open with' bash script

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.

  1. Launch Automator
  2. Select Application
  3. Look for the Run Shell Script action and add it to the right.
  4. Pass input as arguments
  5. Put your script in there
  6. Save somewhere

Here's my version, using the Growl command line utility:

enter image description here

Result:

enter image description here


You can see the effect this change has on ~/Library/Preferences/com.apple.LaunchServices.plist when you Change All:

enter image description here

("Test" is the name I gave my Automator application)

Tags:

Macos

Bash

Script