Created
March 14, 2011 22:33
-
-
Save braveulysses/870019 to your computer and use it in GitHub Desktop.
iTerm: launch multiple sessions
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
-- An iTerm 2 launch script. Opens three terminal windows, | |
-- logs them in to three different hosts, | |
-- and cd's to a common directory. | |
-- | |
-- Place in ~/Library/Application Support/iTerm/Scripts | |
-- | |
global remoteDirectory | |
set remoteDirectory to "/my/project" | |
to launchLabSession(sessionName, hostname, directory) | |
tell application "iTerm" | |
activate | |
set thisTerminal to (make new terminal) | |
tell thisTerminal | |
launch session "Default" | |
set thisSession to current session | |
tell thisSession | |
set name to sessionName | |
write text "ssh root@" & hostname | |
delay 1 | |
write text "cd " & directory | |
end tell | |
end tell | |
end tell | |
end launchLabSession | |
launchLabSession("source", "host1.lab", remoteDirectory) | |
launchLabSession("sync", "host2.lab", remoteDirectory) | |
launchLabSession("destination", "host3.lab", remoteDirectory) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment