10.4: Convert any web page to audio via Automator

May 12, '05 10:21:00AM

Contributed by: mark hunte

Tiger only hintThis hint uses Automator to get a URL and convert the text to an audio file, which you can then play on your iPod. This example uses macosxhints.com, but the concept will work for any site.

Please note this tip originally appeared on engadget.com. I have modified it to work somewhat better, and to work with macosxhints.com.

Open a new Automator action. Select the Safari entry in the Library column, and drag the 'Get Specified URLs' Action to the work area. Enter the URL for macosxhints.com, and then drag over the 'Get text from Webpage' Action, placing it below the previously-placed action.

Now select System in the Library column, and drag over the 'Text to Audio File' Action, again placing it below the others. Select a voice, enter a name for the new file, and select where to save the file.

Select iTunes in the Library column, drag over the 'Import Audio file' Action, select the import encoding (MP3, AAC, etc.; the original will be an .AIFF). Choose any options you want.

Now save this as a Plugin or an application from the File: Save As menu. In iTunes, make a new Smart Playlist that has "Song Name" and "Contains" as the criteria, and enter the name you gave your file. Now run the Automator plug-in/application you created. The original hint on engadget called for you to "use Add files to playlist" from the iTunes Actions, but I found this just made a new playlist with no file added. Also, the Automator got very,very CPU hungry when trying to get my playlists.

[robg adds: The original engadget hint is well worth reading if you're new to Automator -- it's got a lot of screenshots and walks through each step in great detail. The rest of this hint has a downloadable version of the finished action. I tested this, and it worked as described. I'm not sure macosxhints makes good listening, but the tip does work -- there are obviously more suitable pages for this script, which is the real point of it...]

The second part of this hint is that Automator files are saved as application bundles. Inside the contents (control-click on the bundle and choose Show Package Contents) is a .wflow file, which can be read in a text editor.

So if you want to share a .wflow file (on a web page, for instance), but do not want to do it in binary/bundle form, you can copy the contents of the .wflow file, paste them into a plain text file, and save it as a .wflow file. Double-clicking this file will open it in Automator for editing, and then using Save As to create the plug-in or application. Like this, for example, which is the workflow created above. Copy and paste that text (or download the link), rename it to end in .wflow, and then double-click to open the completed Automator action.

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050503162056347