• 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: Downloading the APOD from Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Downloading the APOD from Safari


  • Subject: Re: Downloading the APOD from Safari
  • From: "koenig.yvan" <email@hidden>
  • Date: Fri, 07 Sep 2012 16:18:22 +0200


Le 07/09/2012 à 13:43, Christopher Stone <email@hidden> a écrit :

On Sep 07, 2012, at 06:13, Steve Thompson <email@hidden> wrote:
This version will get the current (ie, today's) picture and put it on the current user's desktop (as a file, not as the desktop picture).

It comes from the no-error-checking-no-forward-thinking-it-just-works school of programming.
______________________________________________________________________

:)

do shell script "cd ~/Desktop && curl -LOs `curl -s http://apod.nasa.gov/apod/ | sed -En 's|.+a.href="" href="http://apod.nasa.gov/apod///1|p'">http://apod.nasa.gov/apod/\\1|p'`"


Thanks.

I edited it a bit with my "standard" tools :

--[SCRIPT]
path to pictures folder as text
set dossier to POSIX path of (result & "APOD_Images:")
do shell script "cd " & quoted form of dossier & " && curl -LOs `curl -s http://apod.nasa.gov/apod/ | sed -En 's|.+a.href="" href="http://apod.nasa.gov/apod/\\1|p'">http://apod.nasa.gov/apod/\\1|p'`"
tell application "ASObjC Runner"
enumerate folder dossier
set thePicture to item -1 of (rearrange files result in order by access date)
name of (about file thePicture)
(do shell script "date +%Y%m%d") & " » " & result
modify file thePicture setting name result
end tell
--[/SCRIPT]


I'm quite sure that there is a neater way to achieve the same goal with some magic wand ;-)

Yvan KOENIG (VALLAURIS, France) vendredi 7 septembre 2012 16:18:08


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Downloading the APOD from Safari
      • From: Christopher Stone <email@hidden>
References: 
 >Re: Downloading the APOD from Safari (From: "emile.a.schwarz" <email@hidden>)
 >Re: Downloading the APOD from Safari (From: Steve Thompson <email@hidden>)
 >Re: Downloading the APOD from Safari (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Downloading the APOD from Safari
  • Next by Date: Re: Downloading the APOD from Safari
  • Previous by thread: Re: Downloading the APOD from Safari
  • Next by thread: Re: Downloading the APOD from Safari
  • Index(es):
    • Date
    • Thread