Applescript - open iTerm2 with multiple named tabs
2,291 views
Skip to first unread message
Sam Critchley
unread,
Oct 27, 2011, 5:25:00 AM10/27/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to iterm2-discuss
Hi,
Here's a simple applescript which will open iTerm2 with 12 named
tabs... you can compile it so it runs instead of starting iTerm2 the
usual way. Of course you can edit it so it also connects to a remote
server etc.
Enjoy!
Thanks,
Sam
=====Begin Applescript=====
-- Activate iTerm
tell application "iTerm"
activate
-- make a new terminal
set myterm to (current terminal)
-- tell the terminal to do something
tell myterm
-- RENAME CURRENT TAB to TAB 1
-- set tab to current tab
set Lsession to (current session)
-- tell the tab something
tell Lsession
-- change the name of the tab
set name to "TAB 1"
-- stop telling the current tab something
end tell
-- START A NEW TAB TAB 2
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name to "TAB 2"
set name to "TAB 2"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB TAB 3
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 3"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB TAB 4
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 4"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB TAB 5
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 5"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB TAB 6
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 6"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB TAB 7
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 7"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 8"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB TAB 9
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 9"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB TAB 10
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 10"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB TAB 11
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 11"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- START A NEW TAB TAB 12
-- start a new session
set Lsession to (make new session at the end of sessions)
-- tell the session something
tell Lsession
-- set the name of the tab
set name to "TAB 12"
-- Tell the session to start tcsh
exec command "/bin/tcsh"
-- stop telling the session something
end tell
-- stop telling the terminal something
end tell
end tell
=====End Applescript=====
George Nachman
unread,
Oct 27, 2011, 2:06:39 PM10/27/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message