• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to script Safari to download a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: How to script Safari to download a file
      • From: LuKreme <email@hidden>
  • Prev by Date: Re: Filemaker
  • Next by Date: Re: Avoiding repetition
  • Previous by thread: How to script Safari to download a file
  • Next by thread: Re: How to script Safari to download a file
  • Index(es):
    • Date
    • Thread