Skip to content

Instantly share code, notes, and snippets.

@vincentmac
Created September 25, 2013 18:03
Show Gist options
  • Star 45 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save vincentmac/6703537 to your computer and use it in GitHub Desktop.
Save vincentmac/6703537 to your computer and use it in GitHub Desktop.
Sublime Text OSX Context Menu

Add Sublime Text to OS X Context Menu

  • Open Automator
  • Create a new Service
  • Add a Run Shell Script action
  • Set input to Service receives selected files or folders in any 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
@leoblum
Copy link

leoblum commented Jan 22, 2021

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