Created
August 28, 2014 16:17
-
-
Save allybee/ca05b21d3f7c61cb8801 to your computer and use it in GitHub Desktop.
AppleScript Service: Takes selected folder in Finder, opens the path in iTerm, and runs grunt.
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
-- create new Service in Automator | |
-- set input to "folders" in "Finder" | |
-- add new task: Run AppleScript | |
on run {input, parameters} | |
set _path to POSIX path of item 1 of input | |
tell application "iTerm" | |
activate | |
set myterm to (make new terminal) | |
tell myterm | |
set s to (make new session at the end of sessions) | |
tell s | |
-- Chose your shell: | |
exec command "zsh" -- zsh | |
-- exec command "/bin/bash -l" -- Bash | |
write text "cd " & _path & ";clear;pwd;" | |
write text "grunt" | |
end tell | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment