Created
June 19, 2014 06:33
-
-
Save jamespan/7c9c256ab0d6d7b119b2 to your computer and use it in GitHub Desktop.
OpenInTerminal.applescript
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
-- OpenInTerminal.applescript | |
-- ForkLift | |
-- Created by JamesPan | |
tell application "System Events" | |
set appWasRunning to exists (processes where name is "iTerm") | |
tell application "iTerm" | |
activate | |
if not appWasRunning then | |
terminate the first session of the first terminal | |
end if | |
set myterm to (make new terminal) | |
-- talk to the new terminal | |
tell myterm | |
-- launch a default shell in a new tab in the same terminal | |
launch session "Default Session" | |
tell the last session | |
write text "cd _forklift_path_placeholder_ ;clear" | |
end tell | |
activate | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment