Drag and drop email to make clickable link in MD doc

If I drag an Outlook email into a Markdown document, I get a path that looks something like this: /var/folders/_b/y382sbl967sb83xmfc6jlvy00000gn/T/com.microsoft.Outlook/C4A6D47B-23CA-4A5B-809B-8843DEF5887D/FW- A4 flyers.eml

A similar thing happens if I drag from Mail, except I get a path starting /Users/amc/Library

In itself, these are not clickable and can’t be used to take me back to the source email. Can some more experienced brain advise on how I turn these paths into a clickable link in Markdown?

I don’t have DT Pro, so I don’t have the email import function.

Background: I keep project notes in a Markdown doc with contacts, briefing notes, etc. Often I also want to reference an email or two, hence the request above. The Mail importer seems a bit heavy-duty for this job.

I suspect those links are to temporary files which are created when you drag and drop; I don’t think they are links into the innards of the mail database in Outlook or Mail. In theory temporary files should be removed somewhere along the way, so that linking to them is possibly moot.

For Mail at least, you can link back to a message using message://<message id>; there is a thread on Stackexchange here explaining more about how to get hold of that ID.

I assume similar functionality for Outlook, but have no means of looking it up in the script dictionary, or testing, as I don’t use Outlook myself.

Edit: when dragging from Mail to an RTF in DT 3 Pro I get a clickable link which uses the above URL scheme. When dragging to an MD document I only get the title of the mail without a link; this thread seems to confirm that behaviour. So a brief script along the lines of the suggestion in the Stackexchange thread and including the whole link in the format [name](message://<message id>)would presumably be the easy solution.


Thanks Blanc. Pretty sure Outlook doesn’t have Applescript, so that’s that. Suspect the easiest solution is to dig a bit deeper and get DT Pro.

Appreciate the response.

I certainly don’t want to discourage you from getting DEVONthink Pro, but I am sure that Outlook does support AppleScript; I just don’t know whether you can get the message ID in the same way you can with Mail (I would guess that you can).

The ‘new’ Outlook doesn’t have Applescript, at least according to the makers of Hook.

I used DT Pro for maybe 15 years, and have several Mail databases archived, but when DT3 came out I decided I didn’t really need the Pro version. And I don’t - except for the email integration, which would occasionally be very handy.

1 Like

I do apologise - I’m stuck in the Windows (read: Microsoft) world of yonder, and had completely forgotten that there’s a new version.

Which version of macOS and DEVONthink do you use? I just tried this on Monterey (12.6) and just the subject of the email was added to the Markdown document.

The legacy interface of Outlook still supports AppleScript (and looks better IMHO).

1 Like

Apologies for the slow response, Christian. I’m using the latest Monterey.

Yes, you just get the mail header from a straight drag-and-drop, but if you hold down the Option key you get a file path, like this: /Users/amc/Library/Mail/V9/1EE352FB-1D92-4ABC-B14F-06DEC82C6830/INBOX.mbox/F6E2D0DF-40B0-43B5-9F57-E7BDCEEF2963/Data/5/7/Messages/75476.partial.emlx

One of those taste things. Old Outlook looks so … Microsofty. New Outlook does too, but a bit more streamlined.

Do you already use version 3.8.6? This version supports drag & drop of emails from Apple Mail (and of Calendar events) to Markdown documents and a link to the original email/event is inserted.

And so it does! I had 3.8.6 on my laptop but not on my work machine.

Thank you for attending to all these details. Small stuff, but good stuff. I appreciate you spending coding time on this and everything else that you’ve responded to over the past two decades.

1 Like