Re: Scripting Terminal for simple FTP
Re: Scripting Terminal for simple FTP
- Subject: Re: Scripting Terminal for simple FTP
- From: Nigel Smith <email@hidden>
- Date: Fri, 04 Apr 2003 12:20:51 +0100
On 3/4/03 20:27, "Andrew Oliver" <email@hidden> wrote:
>
You can 'do script "ftp ftp.mydomain.com",
>
but you cannot interactively log in, or get the directory listing (unless
>
you want to repeatedly 'get contents of window 1" to read the entire
>
terminal screen, which may not work with long file listings). You cannot,
>
therefore see what files are available for download or make the decision as
>
to which file to download.
Don't forget Terminal now also has "history" -- the contents of the buffer
-- as well as "contents" -- the screen. So you could get an extremely long
file listing and grep "history" for the lines you want, then take the last
line of the result (since your example listing would have the latest last by
alphabetical order).
Problem is that scripting the "non-relying" Terminal can be a pretty hit and
miss affair since, unless you build in a lot of checks and delays, you (or
at least I) end up sending commands before the Terminal is ready :-(
So scripting the Terminal for interactive FTP is probably more trouble than
it is worth -- that's what curl is for. Luckily the OP wanted simple ftp,
which is doable.
Nigel
_______________________________________________
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.