Automator PDF text to Spoken Audio file: What’s wrong with this script

audioautomatorpdfscript

I have pages of PDF notes which I want converted to spoken audio to aid revision.

There are several suggested workflows online, but I'm still not getting the results I want.

I used this model from Macworld hints (see comment from chrischram).

An RFT file in TextEdit gets converted happily, but when I try and add a PDF, I get errors.

If I select the text myself, the workflow functions perfectly… What have I missed?

Current workflow (translated from German):

  1. Get finder items
  2. Extract PDF text (as RTF, save to folder)
  3. Get TextEdit document contents
  4. Convert Text to Audio, Save
  5. Import data to iTunes
  6. Add imported data to Playlist

For any help, I'd be grateful!

Best Answer

There might be nothing wrong with the script, but rather with the way the PDF is constructed. Text extraction from PDF is much trickier than simply reading in an RTF file. How has the PDF been created?

Due to lack of a better solution, I’d simply open the PDF in Preview.app, +A, open a new text document in your text editor of choice, +V, save the file, then use that as the text source instead of the PDF file.