Skip to content

Instantly share code, notes, and snippets.

@shauvik
Created May 17, 2015 23:13
Show Gist options
  • Save shauvik/d15acb67a5da681a3c84 to your computer and use it in GitHub Desktop.
Save shauvik/d15acb67a5da681a3c84 to your computer and use it in GitHub Desktop.
Automator task for Finder. Cmd drag to put in Finder bar.
on run {input, parameters}
tell application "Finder"
set dir_path to quoted form of (POSIX path of (folder of the front window as alias))
end tell
CD_to(dir_path)
end run
on CD_to(theDir)
tell application "iTerm"
set _term to (make new terminal)
tell _term
launch session "Default"
set _session to current session
end tell
tell _session
write text "cd " & theDir & ";clear;"
end tell
activate
end tell
end CD_to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment