• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SCP and terminal help needed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SCP and terminal help needed


  • Subject: Re: SCP and terminal help needed
  • From: Axel Luttgens <email@hidden>
  • Date: Thu, 01 May 2003 20:41:50 +0200

Axel Luttgens wrote:

Charles Heizer wrote:

Hello,
I'm trying to write a script to automate coping files to remote hosts. But when I use SCP it does not work, but if I use SSH it works file. Has anyone gotten SCP to work using AppleScript. Oh yea, I really want to avoid using ssh keys for this solution.

[snip]



[snip]
Now, it could perhaps be possible to achieve want you want by using GUI Scripting.
This would have the advantage to stay very close of your original idea: instead of using 'do script' to enter the password, you would just simulate keystrokes.
More infos may be found at: http://www.apple.com/applescript/GUI/

Having found some time to check my suggestion, it appeared that this indeed worked for me:

tell application "Terminal"
activate
do script "scp /Users/luttgens/Desktop/test email@hidden.:/var/tmp"
delay 10
end tell
tell application "System Events"
tell process "terminal"
repeat with c in "mypass"
keystroke c
end repeat
keystroke return
end tell
end tell

And, amusingly (?), replacing the 'do script' line with

do script "ssh ALTi.local."

worked too.


HTH,
Axel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: RE: Creating a Progress Bar, is it possible?
  • Next by Date: Re: Sorting files, making folders
  • Previous by thread: Help - Dictionary crashes Script Editor
  • Next by thread: Bug in Eudora?
  • Index(es):
    • Date
    • Thread