Re: ftp transfer
Re: ftp transfer
- Subject: Re: ftp transfer
- From: Simon Forster <email@hidden>
- Date: Wed, 29 Sep 2004 19:08:29 +0100
On 29 Sep 2004, at 14:12, email@hidden wrote:
I'm investigating the best way to check for files on an ftp site,
download them (if they exist) and delete them.
We are osX 10.3.5.
We have been able to get close with scripting Fetch, but it won't get
(or I haven't found a way to get) individual files and we are using
system events to select all and then download.
Is there an opinion on a better way?
--
David Stevens
Not wishing to disparage the most excellent Fetch, I tend to use do
shell script and curl for all my FTP needs under Mac OS X and
AppleScript. See man curl.
Here's a handler I had knocking around. Note that the file paths need
to be quoted if there's spaces in them.
--Get URLs and download them to theFolder naming with URNs
--getURL({<targetFile>, <sourceURL>}, {<targetFile>, <sourceURL>}...)
--returns nothing
--on getURL({{"'/Users/simonforster/Desktop/Waterfall
Durrant/tmp/106569.jpg'",
"http://lb.dezrez.com/Imaging/PictureResizer.ASP?
PropertyID=92253&PhotoID=1&AgentID=8&BranchID=15&Width=300&Rotation=0"},
{"'/Users/simonforster/Desktop/Waterfall Durrant/tmp/106570.jpg'",
"http://lb.dezrez.com/Imaging/PictureResizer.ASP?
PropertyID=79731&PhotoID=1&AgentID=8&BranchID=15&Width=300&Rotation=0"}}
)
on getURL(toFetch)
repeat with thisItem in toFetch
try
do shell script "curl '" & item 2 of thisItem & "' -o " & item 1 of
thisItem
end try
end repeat
end getURL
HTH
Simon Forster
_____________________________________________________
LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
Tel: +44 (0)70 9230 5244 Fax: +44 (0)70 9230 5247
_____________________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden