Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I get PDFs to revise course content which I want to convert to MP3 files and take with me as spoken audio.

Automator offers 'text to speech' conversion and it's great. When I try and build a workflow around it, seemingly everything happens except what I need.

I want, as a folder action:

  • To extract the text from a PDF dropped on the relevant folder
  • To get this text turned into spoken audio
  • To provide details for iTunes
  • Import this into a playlist of my choosing

I currently have variations on this sequence, which does not work:

  1. Extract PDF Text, save
  2. Convert text to Audio, save
  3. Import Audio
  4. Give iTunes info
  5. Add title to PlayList

Currently the PDF text gets extracted, doesn't end up where I expect, and the script then seems to hang on generating the audio. Simple TextEdit documents work fine.

What's wrong?

(This question is a continuation of one I asked yesterday: here)

share|improve this question
    
So I've just tried to break this dowen into 3 scripts (Extact text; Convert to Audio; Import to iTunes) and I've reached my first hurdle - even the simple 'Add to folder and extract PDF text' doesn't work. What do I have to do to activate a folder scruipt other than saving the workflow? –  Edd Turner Mar 27 '12 at 10:18
add comment

1 Answer

While Automator is pretty useful, I personally find the Terminal / command line a nice place to solve problems like this.

The basic idea is still using the steps you describe, but doing all the work from the command line. I researched a useful PDF-to-Text converter, and I found PDFminer quite useful. If you can get it to run, half of your work is done!

pip install pdfminer

Step one and two, then can be solved with this one-liner in Terminal:

pdf2txt.py example.pdf | say -v Daniel -o example.aiff

Still missing is the addition of metadata — what do you need here: Title / Album / "Artist"?

In a final step, you would add the file to a certain iTunes playlist. Depending on your ideal workflow, one then could build a little LaunchAgent that monitors a folder for new files...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.