Publishers of technology books, eBooks, and videos for creative people

Home > Blogs > Mac Productivity: Quick Scripts and Workflows - Set Desktop to Astronomy Picture of the Day

Mac Productivity: Quick Scripts and Workflows - Set Desktop to Astronomy Picture of the Day

By  Jul 9, 2012

Topics: Apple, Operating Systems, Productivity

Each day, our good friends at NASA are kind enough to share a breathtaking photo of our wonderful universe.  Sometimes of the Earth, sometimes of the heavens, these photos showcase natural beauty that is surely Desktop-background worthy.  Here's how you can create an Automator workflow that runs each night to set your Desktop to the latest photo...

1. Start off by opening Safari and going to the NASA Astronomy Picture of the Day website at http://apod.nasa.gov/apod/astropix.html.

2. Launch Automator (in /Applications)

3. When prompted to choose a type of workflow, select iCal Alarm and click Choose


Creating an Automator iCal Alarm workflow

4. Search for the Get Specified URLs action, and drag it to the workflow area.  Click on the default Apple.com URL to edit it.  Or, remove it and add a new one.  Set it to http://apod.nasa.gov/apod/astropix.html. If you've got Safari opened to the astronomy picture page, then the action should insert it automatically when you click the Add button. 


Adding and Configuring the Get Specified URLs Action

5. Search for the Get Image URLs from Webpage action, and drag it to the workflow area.  You can leave it set to get URLs of images on these webpages.


Adding and Configuring the Get Image URLs from Webpage Action

6. Search for the Download URLs action, and drag it to the workflow area.  Set it to download to your Pictures folder.


Adding and Configuring the Download URLs Action

7. Search for the Import Files into iPhoto action, and drag it to the workflow area.  Set it to import into a New album with a name of Astronomy Pix, and select the Delete the Source Images After Importing Them checkbox.  The action is smart enough to check for an existing Astronomy Pix album before creating a new one, so you shouldn't end up with duplicates every time the action runs.


Adding and Configuring the Import Files into iPhoto Action

8. Search for the Set Desktop Picture action, and drag it to the workflow area.


Adding and Configuring the Set the Desktop Picture Action


The complete workflow.

9. Save the workflow as Set Desktop to APOD.


Saving the Workflow

10. iCal is launched, and an Automator calendar is created if it doesn't already exist.  An event is added to the current day, and set to run the workflow.  Set the event to the desired time, and configure it to repeat every day.


Configuring the iCal Alarm workflow to run on a schedule

Now, each day, at the scheduled time, the workflow should run, download the astronomy picture of the day, import it into an iPhoto album, apply it as your Desktop background, and your mornings should start looking a little brighter.


Example of an Astronomy Picture of the Day

For more on AppleScript and Automator, check out my book  Automator for Mac OS X: Visual QuickStart Guide, as well as my video podcast series Mac Automation Made Simple.