[X4U] [Off Topic] Syntax for file download from Safari

John Azevedo zoff at mac.com
Tue Feb 1 13:14:06 PST 2005


On Feb 1, 2005, at 1:44 PM, Stephen Lanza wrote:

> I regularly download files from a website by control clicking on a 
> link and
> selecting 'Download Linked File as'. I then rename the file to save and
> select a directory to save the file. If I copy the link to the 
> clipboard the
> format is: http://domainname.com/upload/filename.mp3.
>
> I want to write an Applescript to do automatically save the file to a
> specific directory so I was wondering if what the url syntax is to do 
> this


Try this:

set theSite to "http://domainname.com/upload/filename.mp3" --
set theFileName to "filename.mp3" --
set theDownloadlocation to (POSIX path of (path to desktop)) --
do shell script "curl " & theSite & space & " -o " & theDownloadloc & 
theFileName --

Watch out for the line breaks, I've added -- to the end of each line.



More information about the X4U mailing list