Skip to content

Instantly share code, notes, and snippets.

@hex2010
Created September 27, 2016 04:31
Show Gist options
  • Save hex2010/32ac37250865a06bcd7606208260e1b0 to your computer and use it in GitHub Desktop.
Save hex2010/32ac37250865a06bcd7606208260e1b0 to your computer and use it in GitHub Desktop.
Open iTerm2 at folder, Automator service script
on run {input, parameters}
set my_file to first item of input
set dir_path to quoted form of (POSIX path of my_file)
tell application "iTerm"
set newWindow to (create window with default profile)
tell current session of newWindow
write text "cd " & dir_path
end tell
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment