Mail and attachments

For my purposes, the ideal result of importing emails with attachments would be:

  • all images displayed inline in the imported message,
  • all PDFs OCRd and displayed inline in the imported message (see note 1 below),
  • all other kinds of attachments full-text indexed (assuming they contain text), and also displayed inline,
  • barring this, and for all other file types attached to emails, (preferably) displayed in a tab in the message text’s window, or (less preferably) attached to the DT record. (See Note 2 below.)

The goal here is to keep attachments and mail message text together and to display them in either one DT window, or in tabs (one tab for message text, and another tab for PDFs or other attachments other than images (which would always be displayed inline) in the message text.

Note 1:
By “all PDFs expanded in the message,” I mean that the imported messages would behave in the same way as the RTF files that mail.app produces from its File>Save As… function. These when opened in TextEdit or Bean, or QuickLooked, contain the message text, and the PDF within in a scrolling inline frame that is embedded in the message, like this:


The goal is to have the imported message appear like that (and to have imported PDFs OCRd as well and searchable, found words in the PDFs highlighted, etc.).

Note 2:
By “for all other file types attached to emails, (preferably) displayed in a tab in the message text’s window, or (less preferably) attached to the DT record,” I mean that in lieu of displaying these attachments inline or in a tab, attachments other than images and PDFs would be represented by an icon in the imported message, which would be both QuickLook-able and also opened in their native apps when double-clicked.

The solutions that import mail messages that that I’ve found either:

  • produces a DT record that displays only the first page of an attachment in “Best Alternative” mode, and allows toggling into an “Text Alternative” mode that shows the attachment as a double-clickable icon, which when clicked open a PDF in Preview (the behavior of the “Add to DEVONthink Pro Office” plugin), or

  • separate the message and attachment into separate DT records, sometimes in separate groups.

I really don’t know where to begin trying to get mail imported into a DTPO database and making the database usable.

I know that one can import mail using the provided scripts, and I’ve seen other scripts in the Forums, and I know that one can use convert image in script or through the menu system to OCR a PDF in place (which is very handy!), but what is puzzling me is how to keep message text and attachments together in a single DT record, and how o display PDFs inline.

Are any of my ideal goals feasible? Is there a best practice that I can consider?

(As I write this, it occurs to me that a script that imports message text and attachments into separate groups, OCRing PDF along the way, is feasible. They would be associated by name or some other mechanism. Then when either is clicked upon a triggered script would open both and message text and all associated attachments into tabs in a window.)

I know this is a tall order. Many thanks for any feedback.

Hi Shoolie.

I agree with your request and i will give it a +1. :smiley:

Efty