Sublime Text 2 Service Sublime Text 2 Service shell shell

Sublime Text 2 Service


Try setting Pass input: value to as arguments:

enter image description here


Enable OSX Mountain Lion Context Menu Launch:

  1. Open Automator. Add new service.
  2. Search for "Run Shell Script". Drag over to the panel on the right (or double click it).
  3. Enter:

    /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl -a $@

  4. Set "Pass Input:" to "As Arguments"
  5. Set "Shell" to "bin/zsh"
  6. Set "Services Receives Selected:" to "files or folders"
  7. Save as "Open-in-Sublime".

To use: right-click on a file or folder, and click 'Open-in-Sublime' in the 'Services' menu at the bottom of the context menu.

Enable OSX Mountain Lion Terminal Launch:

  1. At the command line enter:

    sudo mkdir /usr/local/bin

  2. Then enter:

    sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

  3. ln creates a link. -s makes it a symbolic link.
  4. You may need to prefix the command with sudo if it doesn't work.
  5. Restart the terminal.

To use:

user$ sublime . [This will open the current folder structure in Sublime]

user$ sublime <filename> [This will open the desired file in Sublime]


Try setting Pass input: value to as arguments.

And "/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl" Path should in double quotes.