Skip to content

Instantly share code, notes, and snippets.

@patrickandre
Forked from conspirator/Grunt Here
Created October 28, 2012 16:36
Show Gist options
  • Save patrickandre/3969095 to your computer and use it in GitHub Desktop.
Save patrickandre/3969095 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