tell application "iTerm" activate set myterm to (make new terminal) tell myterm (* Put your own commands in here Another open_tab for each tab you want to open. Put @@@PASSWORD@@@ where you may be prompted for a password. *) my open_tab("title unisoner cd dev/yap/src unisonpush unisondev") my open_tab("v yroot yap @@@PASSWORD@@@ title relinker-tailer cd dev/yap/src yapl") my open_tab("title cvser cd dev/yap edit .") end tell --terminate first session of current terminal end tell on open_tab(command) set commands to paragraphs in command tell application "iTerm" to tell first terminal launch session "Default Session" repeat with currentCommand in commands if (text of currentCommand = "@@@PASSWORD@@@") then do shell script "sleep 5" set pw to last word of (get text of last session) if pw = "Password" then set pw to text returned of (display dialog "Password:" default answer "" with hidden answer) tell i term application "iTerm" to activate tell last session to write text pw end if else tell last session to write text currentCommand end if end repeat end tell end open_tab