Created
March 15, 2015 14:14
-
-
Save krmnn/b77321b4b9aad7c4d996 to your computer and use it in GitHub Desktop.
Applescript to open the current Finder directory with iTerm
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 | |
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 _session to current session of current terminal | |
on error | |
set _term to (make new terminal) | |
tell _term | |
launch session "Default" | |
set _session to current session | |
end tell | |
end try | |
tell _session | |
write text "cd " & theDir & ";clear;" | |
end tell | |
end tell | |
end CD_to |
Author
krmnn
commented
Mar 15, 2015
- Script Editor -> Export -> as Application
- Drag n Drop to Finder Toolbar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment