Created
December 6, 2012 12:39
-
-
Save samwestwood/4224181 to your computer and use it in GitHub Desktop.
Alfred + iTerm + Terminal Here
This file contains 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
-- Adapted from: | |
-- http://iterm.sourceforge.net/scripting.shtml and | |
-- https://github.com/egrouse/alfred-terminal-here/ | |
set finderPath to "" | |
tell application "Finder" | |
try | |
set finderFolder to (folder of the front window as alias) | |
on error | |
set finderFolder to (path to home folder as alias) | |
end try | |
set finderPath to quoted form of POSIX path of finderFolder | |
end tell | |
tell application "iTerm" | |
activate | |
tell the first terminal | |
launch session "Default Session" | |
tell the last session | |
write text "cd " & finderPath | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment