Filed under: Features, How-tos
Mac Automation: listen to a text document
Don't have time to read that Word, Pages, or TextEdit document at your desk? Why not listen to it on your iPod instead? In this Automator how-to, I am going to show you how to create an audio file using text that you have in an open document, then sync that using iTunes to your iPod or iPhone. Creating the workflow
For this workflow, you need the following Automator actions (placed in the same order):
- Get Contents of TextEdit Document
- Text to Audio File
- Import Files into iTunes
Continue reading to learn how to build this workflow.

Saving the workflow
You can breathe a little because you're half way done. Now, let's save the workflow as an application so it can be re-used at your whim. To save:
- Click File > Save
- Choose "Application" from the Format drop-down box
- Choose a location and file name, then click Save
Running the workflow
To run the workflow, just open TextEdit (this application comes with Mac OS X and can be found in your Applications directory). Type a document in TextEdit, or copy and paste any text you want. When you are ready to convert your TextEdit document into an audio file, just double click on your workflow that you saved in the last step.
The text will then be copied from the document and a dialog will ask you where you want to save the audio file that it will create. You can also specify a system voice to be used. If you are using Mac OS X Leopard, Alex is by-far the best voice for this job.


You can then sync your playlist to the iPod or iPhone of your choice. You will then be listening to your text in no time! You can also combine this with last weeks Mac Automation post to create audio version of websites!
Remember -- if you have a special automation request, feel free to leave a comment or use our contact form.

![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
meatleg said 10:31AM on 2-28-2008
would be nice to be able to save it as an aac or an mp3 file. i just changed a 13 page book into an audio file, and the aiff version was 132MB. of course i can convert it when i import it into iTunes, but it would be nice to save a step...
otherwise i love it!
Reply
jay said 10:38AM on 2-28-2008
Nope works in there.
Reply
jay said 11:12AM on 2-28-2008
I am receiving an error:
Can’t get «class popB» "voice popup" of missing value. (-1728)
?
Reply
Tony said 10:20AM on 2-28-2008
I get the exact same error.
Cory Bohon said 10:28AM on 2-28-2008
Try running it from within Automator and see if the error persists.
Frank said 10:54PM on 2-28-2008
Getting same error as well
Jon said 11:27AM on 2-28-2008
I did something similar to this but made playlist name announcing MP3's to head up each playlist on my iPod. I have an iPod integration module in my Mazdaspeed 6 and while you get really nice steering wheel controls you can't see *anywhere* what track / playlist / etc is playing (not even on the iPod itself! -- there is a mazda logo instead and the iPod is locked).
So to navigate through the playlists easily I needed them to announce themselves... it's quite slick!
Reply
KeynoteKen said 12:08PM on 2-28-2008
For those that have developer tools installed, there's an app called "Speech Synthesis Example" that you can use to record text directly to an audio file. Not as cool as automator, but if you have problems, it's an option! :)
http://www.keynoteuser.com/news/?p=259
Reply
Kirk Rheinlander said 1:24PM on 2-28-2008
You're making this too hard.
Under SYSTEM PREFERENCES>SPEECH, you can check the speak selected text box, and set the key. Then, anything you select in any application, by pressing a key, will be spoken back.
I have used this for years to edit/proof documents I write. Now with 10.5 and the new ALEX voice, it is getting much more human sounding.
Reply
jay Myers said 11:07PM on 2-28-2008
True, but it doesn't save to a audio file that you can listen to on your iPhone, iPod, or just through your Mac.
Tom Bechtel said 1:50PM on 2-28-2008
I was getting the same errors too. I tried it in Automator and it works but not as a stand alone app. Very cool though!
Reply
rei_vilo said 4:46PM on 2-28-2008
Great how-to! The only problem is that the French release of Mac OS X only speaks English, not French. And French text are read with very funny accent :)
Reply
Sam said 6:37PM on 2-28-2008
I got the same errors, but I found that if you save the Automator workflow as a Script Menu item it works brilliantly and is just as accessible (assuming you have the Icon in your menu bar). You could probably save it as a Finder plug-in as well.
Thanks for the great tip Cory.
Reply
Sam said 7:13PM on 2-28-2008
Update - I hope Cory doesn't mind but because this is such an great tool to have available, I have been mucking about with this workflow for a bit and found a slight variation that Meatleg might find useful since it can automatically convert to your chosen compressed format.
The workflow for this goes:
1. Get Contents of TextEdit Document (as before)
2. Text to Audio File (as before)
3. Import Audio Files (with 'delete source files after encoding' selected and 'show this action when the workflow runs' either selected or not - depending on whether you want to change the file type on the fly).
4. Add songs to playlist -- New Playlist -- (type the name of your new playlist in here).
This is a bit neater for me, because it doesn't leave the source file on the desktop and it doesn't leave the AIFF file stuck in the iTunes library.
Reply
jay Myers said 11:25PM on 2-28-2008
I think this is better. Is there a way to set up a keystroke to this?
Jutzuro said 3:50AM on 2-29-2008
Getting same error as Jay:
"Can’t get «class popB» "voice popup" of missing value. (-1728)"
Any suggestions please?
Reply
Alessandro Vernet said 5:36PM on 2-29-2008
Works great! I am just wondering if there is a way to pass parameters to the Text to Audio File action, such as speed.
Alex
Reply
Mike C said 4:24AM on 3-18-2008
Why not add Doug Adams 'Make Bookmarkable' script, this would get text based files out of the music library and into Audiobooks.
Reply
francesco said 1:06PM on 5-18-2008
As a terminal junkie my advise is this.
Save you text file to the desktop. Please be sure is plain text file.
Open the terminal
Type
say -f [yourtextfile.txt] -o [myoutputfile.aiff]
eventually if you have an mp3 encoder installed you can directly stream the aiff to mp3 with the |
cheers
Reply