web to audio
This how-to uses the new Automator feature in Mac OS X 10.4 Tiger to set up a Workflow that can load up your iPod with audio content generated from one or several web sites of your choice by running one simple application. This is ideal for converting a selection of morning news and blogs into an audio file you can take with you to listen in the car. Plus, it's pretty simple and quick to set up, and serves as a basic introduction to working with Automator, as well.


Background

Automator is one of the most useful of the new features in Tiger. It allows you to build up complex actions you find yourself repeating manually, and execute them in one double-click, or even from a contextual menu. Even consolidating a four-step process into one step can be a valuable time-saver when you usually repeat those actions several times per day. Plus, you don't have to know other programming or scripting languages to get good use out of Automator (though if you do, you're going to feel right at home).

We've been hankering after a solution to get a quick dump of our RSS feeds into an audio file to sync with an iPod and listen to in the car. The text-to-speech functionality has been integrated into OS X since the beginning, but thus far it hasn't been terribly practical to go through all the steps to first convert the text to audio, then go into the Finder to import the file into iTunes for syncing. Automator can roll all of that into one step, making it a task that finally reaches a balance of effort output to result.


What you'll need

  • Macintosh running OS X 10.4 Tiger
  • iPod

See? We told you it was simple. Let's get rolling right away.


Create an Automator Workflow

First, launch Automator. A new workflow will be started automagically, or start a new workflow (File > New or apple-n) if Automator is already open.

WTA1

Click on the Safari entry under the Applications folder. The available actions in the Actions pane will change to reflect the options available for Safari. Click and drag the "Get Specified URLs" action into the workflow pane:

WTA2

Within the action window there is a pane where we can input all of the URLs we want to fetch. We tried this at first using the URL of an RSS feed, but we ended up getting an audio file on the plain XML file unrendered instead of the RSS feed as rendered by Safari, which is what we would want in a perfect world — which is confusing. We're not sure why it would work that way. But anywho, it turns out that just putting in the URL of a blog or news site more often than not gets us the result we want: the textual content of that page converted to an audio file. There are limitations to this, and you'll have to figure out which of your favorite blogs and news sites work well, and which don't. Sites that display their main content in the leftmost pane seem to work best (like Engadget, and the rest of the Weblogs, Inc. network — shameless plug!). Anyway, this isn't meant to be the be-all end-all system — this is quick and dirty at its best. Let's move on.

Type or cut and paste in the URLs of your favorite blogs and news sites. As mentioned above, some trial and error is probably going to be required here.

WTA3

Next, pull in the "Get Text from Webpage" Action from the Safari Actions pane. You'll see the "flow triangle" on the right leading from step 1 to step 2 in the workflow pane:

WTA4

Next, click the System icon in the far left pane in the Automator, to display the Actions associated with the System. One such Action is "Text to Audio File," which is the next Action we want to pull in to our workflow:

WTA5

You can set some parameters in the "Text to Audio File" pane, such as which system voice will read the text (we're big on Victoria — YMMV. Some of them are really no good for anything other than a good laugh.), where the resulting file will be saved, and what it will be named. If you don't choose a name, it will be named by default, imaginatively, "audio text," "audio text 1," and so on, incrementing each time you run the workflow script.

WTA6

Next, click on iTunes in the far left pane where the applications are listed. Again, the Actions pane will change to reflect the available Actions associated with iTunes. The next Action we want is named "Add Files to Playlist:"

WTA7

You can choose to create a new playlist for the Audiofeeds to go, or add them to an existing playlist that you already sync with your iPod. We've created a playlist just for these "Audiofeeds":

WTA8

So we just select the "Add files to playlist" and drag it into the right Automator pane, and this completes our Automator workflow:

WTA9

Now, we've got a couple of different ways we can save this workflow as an application or script. We can save it as a double-clickable application to be launched from the Finder. Or, we can save it as a "Plug-in," which will let us stick a command conveniently in the Script menu. It's up to you — we're using the latter method, which we'll walk you through. In Automator, go to the File menu and choose "Save as Plug-in...":

WTA10

In the "Plug-in for:" drop-down menu, choose "Script Menu." Give this script some sort of descriptive name. We're calling ours "Morning audio feed." Your script is now saved, and you can access it both within automator inside the "My Workflows" folder at the leftmost pane, as well as from anywhere right from the Scripts menu. If you're not familiar with using the scripts menu, it lives at the upper right in the menu bar and contains lots of handy little widgets that help you automate and simplify processes. Our new application now lives at the bottom (you can also organize your Automator scripts into folders in the Script menu):

WTA11 redux

When you want to trigger the workflow we've made, just select it from the script menu. You'll see some status messages flashing on the right in the menu bar as each action gets executed:

WTA12

When complete, iTunes will be foregrounded and you can see the resulting audio in the playlist you selected. A separate file will be created for each of the URLs you specified in the "Get Specified URLs" pane, in the order you specified, instead of making one massive file. Now, next time you sync your iPod you'll get the latest posts (assuming you set up iTunes to sync the playlist you chose) in audio format, as read in the ever-engaging style of the operating system voices, ready to take with you on the go.

web to audio

Limitations and going further

This is just the beginnings of a system, and also a basic introduction to using Automator in Tiger. It would work far better if "Get Text from Webpage" could just pull content from a parsed RSS feed. Surely someone will either create such an action for Safari or for one of the third-party RSS readers, which will kick the ass of this interim system. Even better — if the iSpeakIt application had associated Automator actions, it would be very easy to convert this into a one-click full RSS to audio solution (if you can live with a couple of extra steps, you might want to give iSpeakIt a try, anyway). And admittedly, sometimes the system voices are worth more as a laughter aid than an informative one, as well. But hey — who's gonna turn down some extra laughs on the way to work?


Update

: Peter Cooper suggests using RSSDigest to generate an Automator-readable URL that will fetch just the feed content. Sweet! Steve offers some variations on the above method. Thanks!!

The Engadget Interview: Bill Gates, Part 2