• 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: email@hidden
  • Date: Sat, 17 Jul 2004 07:32:32 -0400

Instead of using 'Safari', consider the code below.

----- Code starts here -----

set dateString to "dn" & (do shell script "date +%Y-%m%d") -- Get 'date's year, month, and day, and adds 'dn' before them.
set dateString02 to dateString & "-1_64kb.mp3" -- Get 'dateString' and add '-1_64db.mp3' to end of it.

do shell script ("curl http://audio03.archive.org/3/audio/"; & dateString & "/" & dateString02 & " -o " & POSIX path of (((path to desktop) as string) & dateString02))

----- Code ends here -----

Since it is now 17.07.2004 but only the 16.07.2004 '.mp3' file is currently available - at the time of this reply - you may have to temporarily comment out the 'set dateString ...' and add 'set dateString to "dn2004-0716"', before the 'set dateString02 ...' line, to test the above code.
--

SJWL
_______________________________________________
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.


  • Prev by Date: Re: Avoiding repetition
  • Next by Date: Re: Avoiding repetition
  • Previous by thread: Re: How to script Safari to download a file
  • Next by thread: Re: How to script Safari to download a file
  • Index(es):
    • Date
    • Thread