Created
November 28, 2016 21:12
-
-
Save russkociuba/7020726871cbbacd7640ebda3de025de to your computer and use it in GitHub Desktop.
Opens a new iTerm2 window with multiple tabs each executing a command set in the script
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
# The list of commands to run in each tab of the terminal window | |
set cmdList to {"ssh [email protected]", "ssh [email protected]"} | |
# You can append to the list just to break up really long lines | |
# set cmdList to cmdList & {"ssh [email protected]"} | |
tell application "iTerm2" | |
# Not sure how to create an "empty" window so for the window we pick the | |
# first command in the list | |
set newWindow to (create window with default profile command item 1 of cmdList) | |
# Personal preference - adjust as you see fit. You can get fancier | |
# by getting the desktop size and setting these relative to that if you want | |
tell newWindow | |
# bounds are top left X, Y, width, height | |
set bounds to {75,150,1500,800} | |
end tell | |
# Create new tabs for the rest of the commands. If there is no | |
# item 2+ this simply doesn't do anything (i.e. it doesn't throw an error) | |
repeat with x from 2 to count of cmdList | |
tell newWindow | |
create tab with default profile command item x of cmdList | |
end tell | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had some weird errors with this script. However, I just it to create a new one that works beautifully
I also enhanced it to also change the session titles
Just make sure to manually set the
Title
(in profile settings -> general) to onlyName
and uncheckApplications in terminal may change the title