OCR email attachments after import


I’ve imported thousands of emails into DTPO. Emails with attached PDF files are shown as you can see here (the icon depends on PDFpen Pro):

Now I want to OCR all of the PDF files in the database and store the OCR’ed files in a new group.

How can I get it?

Kind regards, Friedrich

Somewhere here (can’t locate it right now) there is a script that will extract attachments from imported emails. Once extracted, you could do what you what.


As far as I can see there is no way to deal with mail attachments in DT’s applescript dictionary when they form part of a message. DT also can’t search these attachments. I have searched for the script korm mentioned and couldn’t find it.

You have to take one of two approaches at the time of importing: Use either:

  • the ‘Add messages and attachments’ apple mail script that ships with DT. This will save messages and attachments as separate items which can then be sorted, ocred etc; or

  • Use a program like email archiver, which exports emails as pdfs with the attachments in related directories. (See this thread for an explanation of some of the possibilities of this approach - [url]Email Archiver - Using the output in DT])


IIRC, the script selects a document in DEVONthink, if it is opened the .eml document in Mail, extracted the attachment(s) to an indexed folder, and closed the message.

Is there any other solution to OCR attached .pdf files imported from emails from Apples Mail or is the method of dragging it out and import it separately to DTPO still the rule?

The rule would still apply.