Skip to content

Instantly share code, notes, and snippets.

@allybee
Created August 28, 2014 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allybee/ca05b21d3f7c61cb8801 to your computer and use it in GitHub Desktop.
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.
-- 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