Created
January 17, 2019 02:57
-
-
Save Chovin/e79a7a4400d2c313c840f247ee20f3a9 to your computer and use it in GitHub Desktop.
Open folder/file(s) in sublime w/ a keystroke. Pretty sure I got this from some stackoverflow but not sure where, sorry!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Run AppleScript | |
on run {input, parameters} | |
tell application "Finder" | |
set myWin to window 1 | |
set loco to selection | |
if the number of items in loco is greater than 0 then | |
set koko to the first item of loco | |
else | |
set koko to insertion location | |
end if | |
-- at this point, koko is a full path to the selection, or first item of it | |
-- return koko -- remove the comment, you'll see | |
set soco to (quoted form of POSIX path of (koko as string)) -- this convert HFS+ format to POSIX format | |
-- display dialog soco | |
do shell script "/usr/local/bin/subl -n " & soco | |
end tell | |
return soco | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment