- 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
-
-
Save vincentmac/6703537 to your computer and use it in GitHub Desktop.
Thanks :)
Thanks a lot
Awesome. Thanks!
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.
Great, much appreciated!
👍
It can't work to me.
When I right click a .py file from Finder or Desktop, there is no menu/sub-menus named like "Open in Sublime Text".
I don't know what I missed.
Worked for me..thanks!
Thanks!
Worked for me as well. Thanks, man!
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 👍
awesome!