I've used some neat example's from attached URL's. What I've got so far is the script opening several tab's with ssh session's. But as I've several client's to whom's server's I connect I don't want a script with a hard coded list for every client. I want a dialod box asking to which list I'ld like to connect...
But now that I tried to add a dialog I'm stuck:
--set wseServer to {"xen", "bcs", "db", "lx", "mgr", "nx", "proxy", "smb", "wiki", "zarafa"} as list
set wseServer to paragraphs of (do shell script "/bin/cat $HOME/.ssh/hostlist-wse-deb.pssh")
--set edlServer to {"edl", "edev", "edb", "emon"}
set edlServer to paragraphs of (do shell script "/bin/cat $HOME/.ssh/hostlist-edl.pssh")
set allServer to wseServer & edlServer
set serverList to button returned of (display dialog "Dude, choose your prefered connection List" buttons {"wseServer", "edlServer", "allServer"} with title "SSH Server" default button 3 with icon caution giving up after 5)
tell application "iTerm"
activate
set myTerm to (make new terminal)
tell myTerm
repeat with hostItem in serverList
set Lsession to (make new session)
tell Lsession
--set secureshell to hostItem exec command "ssh " & hostItem
exec command "ssh " & hostItem
--sleep to prevent errors if we spawn too fast
do shell script "/bin/sleep 0.01"
end tell
end repeat
end tell
end tell
After choosing one of the items from the dialog iterm opens 8 Tabs, doesnt execute ssh and closes them... No error no nothing!
This is the example I'm trying to expand: http://code.google.com/p/iterm2/wiki/AppleScript
I know I'm nearly there but can't see the solution!
Hope one of you has a hint...
Thx in advance