Skip to content

Instantly share code, notes, and snippets.

@conspirator
Created January 31, 2012 14:17
Show Gist options
  • Save conspirator/1710717 to your computer and use it in GitHub Desktop.
Save conspirator/1710717 to your computer and use it in GitHub Desktop.
The following AppleScript opens up Terminal, navigates to the path of the active Finder window, opens that directory in Sublime Text 2, and finally kicks off Grunt.js.
-- ========================================
-- Author: Christopher Webb
-- Web: http://conspirator.co
-- Twitter: http://twitter.com/conspirator
-- ========================================
set finderPath to ""
tell application "Finder"
try
set finderFolder to (folder of the front window as alias)
on error
set finderFolder to (path to home folder as alias)
end try
set finderPath to quoted form of POSIX path of finderFolder
end tell
tell application "Terminal"
activate
do script "cd " & finderPath & " && subl . && grunt"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment