Re: Downloading a file from the internet with a URL
Re: Downloading a file from the internet with a URL
- Subject: Re: Downloading a file from the internet with a URL
- From: "Stockly, Ed" <email@hidden>
- Date: Thu, 12 May 2016 23:58:01 +0000
- Thread-topic: Downloading a file from the internet with a URL
>
>Note that the curl script will download one file, if you want the
>pictures or other kind of files, you have to find them and download them
>separately.
>
That's good to know. In this case I'm simply downloading zip files and
pdfs, so all I need is the one file with each download.
Here's the handler I'll be using, with handler calls:
set fileToDownload to "https://support.apple.com/fr-fr/HT1582"
set localPath to "/Users/user/myLocalFileName6.html"
DownloadFile(fileToDownload, localPath)
set localPath to "/Users/user/myLocalFileName7.html"
DownloadFile(fileToDownload, localPath)
set localPath to "/Users/user/myLocalFileName8.html"
DownloadFile(fileToDownload, localPath)
on DownloadFile(fileToDownload, localPath)
set fileToDownload to quoted form of fileToDownload
set quotedlocalPath to quoted form of localPath
set downloadShell to "curl " & fileToDownload & " >> " & quotedlocalPath
set shellResult to do shell script downloadShell
delay 2
tell application "System Events" to set localPath to POSIX file
localPath as alias
tell application "Finder" to reveal localPath
return localPath
on error errMsg
return errMsg
end try
end DownloadFile
_______________________________________________
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