Search code examples
shellservicesublimetext2automator

Sublime Text 2 Service


I'm attempting to make an open in Sublime Text 2 service via Automator.

I am doing this by:

  • Running Automator
  • Adding a new service
  • Adding "Run Shell Script"
  • Setting Shell to /bin/zsh
  • Entering a command line of: /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl -n $@
  • Setting "Service receives selected" to "files or folders"
  • Click save

Screenshot:

enter image description here

However, whenever I try to open a folder via right-click > services > "Open in Sublime", a new ST2 window is opened but with a randomly named text file (ie subl stdin N188RN.txt) and it's output is the path of the folder opened (ie: /Users/me/Desktop/project).

Screenshot:

enter image description here

Is there a way I can modify the automator command line to fix this?


Solution

  • Try setting Pass input: value to as arguments:

    enter image description here