Created
August 28, 2014 08:37
-
-
Save robsonke/eded13bea58b505682e8 to your computer and use it in GitHub Desktop.
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
-- Modified script, based on: | |
-- http://peterdowns.com/posts/open-iterm-finder-service.html | |
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 | |
try | |
set t to the last terminal | |
on error | |
set t to (make new terminal) | |
end try | |
tell t | |
launch session "Default Session" | |
tell the last session | |
write text "cd " & theDir | |
write text "ls" | |
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