There is an action in Automator that allows you to programmatically "Extract PDF Text", but it fails when fed a moderate amount of files (25 to 100). Worse, it fails without logging anything helpful except for a message that "Automator Quit Unexpectedly".

Does anyone know of an equivalent command for doing this in Applescript? I am looking for tools where I have more control over things like logging and error handling so I can be more efficient in processing PDF files into a text format.

  • To avoid trivial answers like "yes" and "no" and perhaps, use Applescript to call an Automator app to perform the extraction, please consider explaining why Automator isn't the tool for you. The more "why" you can add, the easier it is for someone to answer. You don't need to do anything, though - someone might have just the answer you seek with the details provided. – bmike Apr 30 '13 at 13:05
  • @bmike part of the issue is that automator keeps crashing when I try to implement the text extraction workflow...and the crashes seem "random". i.e., the workflow will iterate through a different # of PDF files, extracting text nicely and then Automator will die with "Automator Quit Unexpectedly"...So...Automator isn't doing the trick...I may be able to add error handling if specific PDF files are causing the crashes (which doesn't seem likely), but in the end Applescript gives me finer control over what I'm doing. – user141146 Apr 30 '13 at 13:42
  • @user141146 You could try sejda.com – Simon Apr 30 '13 at 13:53

I don't know how it compares against other options, but you could use pdfotext. It can be installed with brew install xpdf.

do shell script "/usr/local/bin/pdftotext /usr/share/doc/bash/bash.pdf -" without altering line endings

Calibre also comes with some command line utilities:

/Applications/calibre.app/Contents/MacOS/ebook-convert /usr/share/doc/bash/bash.pdf /tmp/output.txt

Related questions:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .