Created
November 21, 2012 00:00
-
-
Save yuhonas/4122118 to your computer and use it in GitHub Desktop.
iTerm / Sublime 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
tell application "System Events" | |
# create an iTerm session if we dont have one | |
if not (exists (processes where name is "iTerm")) then | |
tell application "iTerm" to (make new terminal) | |
end if | |
tell application "iTerm" | |
activate | |
tell the current terminal | |
set SublimeSessionName to "sublime" | |
set SublimeSession to false | |
# loop through all our iterm sessions looking for our sublime session | |
repeat with iTermSession in sessions | |
if name of iTermSession is SublimeSessionName then | |
set SublimeSession to iTermSession | |
exit repeat | |
end if | |
end repeat | |
# create the session if we cant find our beloved sublime session | |
if SublimeSession is false then | |
set SublimeSession to (make new session at the end of sessions) | |
tell SublimeSession | |
set name to SublimeSessionName | |
#set background color to "blue" | |
end tell | |
end if | |
select SublimeSession | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment