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: Stephen Lanza <email@hidden>
- Date: Mon, 19 Jul 2004 15:11:58 -0400
On 07/17/04 1:00 AM, "email@hidden"
<email@hidden> wrote:
>
Date: Fri, 16 Jul 2004 23:24:32 +0200
>
Subject: Re: How to script Safari to download a file
>
From: jj <email@hidden>
>
To: applescriptmaillist <email@hidden>
>
>
> 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
Thanks for the code.
Stephen Lanza
Software Complement
_______________________________________________
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.