ScriptLife

  • Learn AppleScript
  • About me
  • Archive
  • RSS
  • Ask me anything

Create a dynamic “Today In History” wallpaper with AppleScript.

An example wallpaper generated by the scriptOkay, this one is a little more advanced than the other scripts I’ve posted and it requires the command line tool ImageMagick (free, open source) to be installed on your system.

Here’s what it does:

  1. Use curl to download the html source of this webpage.
  2. Use AppleScript’s text item delimiters to extract the text entries.
  3. Use the “strip” handler to remove html tags from the extracted text.
  4. Use the “ordinalSuffix” handler to format the date.
  5. Pass the collected text to ImageMagick to produce a jpeg with the text.
  6. Ask Finder to set the created image as the desktop wallpaper.

I’ve created a Gist with the entire code which you can copypasta into the AppleScript Editor, but you need to manually edit some portions of the script to fit your own system. Read the comments in the start of the script for detailed instructions. If you still can’t make it work, leave a comment here and I’ll see if I can help you.

  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Recent comments

Blog comments powered by Disqus
← Previous • Next →

Logo

About

The adventures of a scripter learning the trade. Currently I'm focused on AppleScript and Unix. I'm also learning Java and Cocoa / Objective-C but this blog is focused on scripting.
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr