Wednesday, April 23, 2008

Getting Alex to read you to sleep (Make your own Audiobooks on a Mac)

I have recently undertaken some training in which I have to cover a massive amount of material. Being the natural procrastinator that I am I immediately went on the prowl for better books, better methods and all other sorts of periphery that doesn't actually count as studying.

One of these projects was to convert the text versions of my study guides to audio so that I could listen to the text in the car while I drive (an ideal time to study). The process was actually surprisingly simple.

Here is a procedure to convert PDFs to Audio books.

1) Open the document in Preview.

2) Command + A (Select All), Command + C (Copy).

3) Open a new document in TextEdit.

4) Paste the contents into the new document (Command + V)

5) Convert the document to Text (Format -> Make plain text)

6) Save the file to a .txt document. For this example we use rawfile.txt

At this stage you might want to do some cleanup. I use a little Perl Script listed below. You might want to do some Regular Expression hacking do clean up the document from things like Footers, Headers or Page Numbers.

while (<>) {
s/^\d+\/.*$//; #Remove page numbers
s/Chapter \d+: [\s\w]+//;
#Remove image and figure references
s/^Figure \d+.*/;
#Remove - continuations from end on lines.
if (s/-.$//) {

7) Save to the file system. And make it executable:
$chmod u+x

8) Clean up the text document:
$cat rawfile.txt | ./ > cleanfile.txt

9) Open the file cleanfile.txt in TextEdit (you might have to choose the UTF-8 type)

10) Fire up Automator and create a Custom script with two actions.
  • Text -> Get Contents of TextEdit Document

  • Music -> Text to AudioFile

Select an appropriate target directory and filename. I highly recommend choosing the voice Alex

11) Make sure your cleanfile.txt document in TextEdit is selected.

12) Go back into Automator and hit Play.

13) Sit back and relax while Leopard converts your text to an Audio file.

From there you can import the audio file into iTunes, convert it to Mp3 if you want and sync it to your iPod to take the book on the road.

Guess I should start studying now...

I'll do some home work while I listen to my fresh Audiobook :-)


For all my thousands (not!) of followers, I am also available on Twitter now. Just have a look at the side-pane for more information.

Wednesday, April 09, 2008

Getting Things Done with Leopard

Stumbled across this post about how to setup a GTD system with Applications that ship with Leopard. Go check it out:

I personally use OmniFocus and have found it to be a great productivity booster.

Time to test Firefox 3 on the Mac

If you have not yet grabbed Firefox 3 Beta 5 from Mozilla ( you should try it now. Up until Beta 4 plug-ins were pretty broken. I am happy to see that my Nopassword,, Passwordmaker and other plugins work properly now.