Skip to content

Instantly share code, notes, and snippets.

@littlelazer
Created June 10, 2014 20:56
Show Gist options
  • Save littlelazer/cee666ba49d01d353561 to your computer and use it in GitHub Desktop.
Save littlelazer/cee666ba49d01d353561 to your computer and use it in GitHub Desktop.
Open Finder Folder in iTerm tab
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"
activate
try
set t to the last terminal
on error
set t to (make new terminal)
end try
tell t
launch session "Default Session"
tell the last session
write text "cd " & theDir & ";clear;"
end tell
end tell
end tell
end CD_to
@littlelazer
Copy link
Author

Slightly modified from http://peterdowns.com/posts/open-iterm-finder-service.html
Check the updates to that post for instructions
Basically you just create a new application in Automator and have it run this applescript. Then drag that app into the Finder toolbar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment