Created
April 28, 2011 04:46
-
-
Save tanob/945821 to your computer and use it in GitHub Desktop.
AppleScript to open a new tab in iTerm2 from Finder
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
-- Stefan van den Oord, 2010-12-29 | |
-- The "cd to" command for iTerm2 | |
-- Original from: http://code.google.com/p/iterm2/wiki/AppleScript | |
-- Modified to open a new tab instead of a new window | |
tell application "Finder" | |
set _cwd to POSIX path of ((folder of (front window)) as alias) | |
end tell | |
tell application "iTerm" | |
activate | |
set _term to last terminal | |
tell _term | |
launch session "Default" | |
set _session to current session | |
end tell | |
tell _session | |
write text "pushd \"" & _cwd & "\"" | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment