- Open Automator
- Create a new Service
- Add a
Run Shell Script
action - Set input to Service receives selected
files or folders
inany application
- Set the script action to
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n $@
- Set Pass input to
as arguments
- Save as
Open in Sublime Text
Created
September 25, 2013 18:03
-
-
Save vincentmac/6703537 to your computer and use it in GitHub Desktop.
Sublime Text OSX Context Menu
Thank you!
@vincentmac what if i want "Open in Sublime Text" to appear at the top level context menu and not under the "services" item,
thanks in advance.
great
you can also do this if you want to open the parent directory of the selected file:
FOLDER="$(dirname "$@")"
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n $FOLDER
Requirement -> /bin/bash
Originally tried /usr/bin/zsh
but that threw errors.
For my environment, I needed to wrap $@ in quotes
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
or else it opened up a bunch of nonsense when the path contained whitespace.
Thank you 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Worked for me as well. Thanks, man!