Re: How to script Safari to download a file
Re: How to script Safari to download a file
- Subject: Re: How to script Safari to download a file
- From: jj <email@hidden>
- Date: Fri, 16 Jul 2004 23:24:32 +0200
>
I download an audio file from a webpage each day and would like to automate
>
the process.
>
>
I can use the following script to get the audio file to play on a web page
>
but I want to download the file instead of playing it.
>
>
tell application "Safari"
>
activate
>
if not (exists document 1) then
>
make new document at the beginning of documents
>
end if
>
set the URL of the front document to
>
"http://www.archive.org/download/dn2004-0716/dn2004-0716-1_64kb.mp3"
>
end tell
>
>
Basically, I want to save the file as if I control clicked on the url and
>
selected the 'Download linked file as ...' command
You can use "curl" in a "do shell script":
do shell script "cd ~/Desktop; curl -O
http://server.com/file.mp3"
(just use your download location instead of "~/Desktop")
jj
--
http://www.macscripter.net/
http://www.osaxen.com/
_______________________________________________
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.