Created
February 20, 2012 09:55
-
-
Save fvianello/1868621 to your computer and use it in GitHub Desktop.
This Applescript take the selected file in Finder and open it with Sublime Text 2 (~/bin/subl). Using Alfred you can bind a global hotkey for this script, so you can edit your files with just a keypress, without worrying about the default editor.
This file contains 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
tell application "Finder" | |
activate | |
set filePath to (POSIX path of (target of front window as alias)) | |
set fileAlias to the selection as alias | |
set fileName to name of fileAlias | |
do shell script "~/bin/subl " & filePath & fileName | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment