Created
March 23, 2016 14:25
-
-
Save keeprock/13eee5abca99c471e6e9 to your computer and use it in GitHub Desktop.
Open current Finder folder in iTerm2 version 3 beta
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 | |
tell current window | |
try | |
set t to (create tab with default profile) | |
end try | |
tell t | |
tell current session | |
write text "cd " & theDir & ";clear;" | |
end tell | |
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