Skip to content

Instantly share code, notes, and snippets.

@ctran
Created December 21, 2015 03:46
Show Gist options
  • Save ctran/e9b7b7990c8f6ea9a089 to your computer and use it in GitHub Desktop.
Save ctran/e9b7b7990c8f6ea9a089 to your computer and use it in GitHub Desktop.
Open selected folder in Sublime Text (Finder)
on run
tell application "Finder"
if selection is {} then
set finderSelection to folder of the front window as string
else
set finderSelection to selection as alias list
end if
end tell
subl(finderSelection)
end run
-- script was drag-and-dropped onto
on open (theList)
subl(theList)
end open
-- open in Sublime Text
on subl(listOfAliases)
tell application "Sublime Text"
activate
open listOfAliases
end tell
end subl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment