Created
June 10, 2014 20:56
-
-
Save littlelazer/cee666ba49d01d353561 to your computer and use it in GitHub Desktop.
Open Finder Folder in iTerm tab
This file contains hidden or 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.