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
-- tip of the hat to Paul Calnan http://www.paulcalnan.com | |
-- for his Open Terminal Here extension that inspired this one | |
-- in fact half the code is nicked from him | |
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 | |
-- make a new terminal | |
set myterm to (make new terminal) | |
tell myterm | |
-- set size | |
set number of columns to 80 | |
set number of rows to 25 | |
end tell | |
-- talk to the first terminal | |
tell myterm | |
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