Re: OT: Curl
Re: OT: Curl
- Subject: Re: OT: Curl
- From: "EU - Luca Pozzato" <email@hidden>
- Date: Tue, 22 Jan 2008 18:47:16 +0100
hi Rick,
this can be a starting point
set FTP_ADDRESS to "ftp://USER:email@hidden/FOLDER/"--set up your address
set mylist to paragraphs of (do shell script "curl -l " & FTP_ADDRESS)
set MYFILE_LIST to choose from list mylist with multiple selections allowed-- you should
choose proper files
if MYFILE_LIST is not false then
set destfoder to (path to desktop as text) & "MYdownload:"
do shell script "mkdir -p " & quoted form of POSIX path of destfoder
set ERROR_LIST to {}
repeat with remoteFile in every item of MYFILE_LIST
set curlScript to "curl -f " & FTP_ADDRESS & " " & remoteFile & " -o " & quoted form of
POSIX path of (destfoder & remoteFile)
try --an error is generated if you try to download a folder
set theCurledResult to do shell script curlScript
on error MYERROR
set ERROR_LIST to ERROR_LIST & (MYERROR as text)
end try
end repeat
return ERROR_LIST--if you want to check what went wrong
end if
ciao
Luca
-----Original Message-----
From: Rick Dwyer <email@hidden>
To: Applescript Users <email@hidden>
Date: Tue, 22 Jan 2008 11:24:11 -0500
Subject: OT: Curl
> Hello list.
>
> This has more to do with the Curl command than Applescript,
> regardless of whether I use and Applescript to call it, but I am
> hoping someone can help me.
>
> I call a curl command to connect to an FTP site. I want to download
> every file in the directory to a local directory, but with the code
> below, curl simply returns a listing of files and does not download
> them. How do I:
>
> 1- tell curl to download the files instead of listing them?
> 2- specify the local directory to download the files to (overwriting
> existing)?
>
> curl -P 192.168.x.x -u myuser:mypass ftp://ftp.remoteserver.com/
>
> Thanks
>
>
> --Rick
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> ografica.it
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >OT: Curl (From: Rick Dwyer <email@hidden>) |