this has been talked about before on this forum… how to get ssh and applescript working…
this code works fine… the script automatically ssh’s into the system after 10 seconds.
set theServer to "theServer" --change to IP or DNS (blabla.com)
set theUser to "theUserAccount" -- change to your login name
set thePassword to "thePassword" --your password
set theWait to 10 -- number of seconds you want the script to wait before it enters your password
tell application "Terminal"
activate
end tell
tell application "Terminal"
repeat with theWindow in window 1
do script "ssh " & theServer & " -l " & theUser in theWindow
delay theWait
do script thePassword in theWindow
end repeat
end tell
but… if you try scp… the password is never entered into the terminal… it just sits there… if you manually type the password in… it runs fine.
set theServer to "theServer" --change to IP or DNS (blabla.com)
set theUser to "theAccount" -- change to your login name
set thePassword to "thePassword" --your password
set theLocFile to "the/path/to/file" --local path to file
set theRemFile to "thefile.txt" -- remote file name
set theWait to 10
tell application "Terminal"
activate
end tell
tell application "Terminal"
repeat with theWindow in window 1
do script "/usr/bin/scp" & theLocFile & theUser & "@" & theServer & ":" & theRemFile in theWindow
delay theWait
do script thePassword in theWindow
end repeat
end tell
any thoughts on why the script won’t apply the password to the 1st terminal window?