Airmail to DTTG using new URL scheme

The new DevonThink URL scheme has opened up automation on the iPad a lot more. Getting properly formatted emails into DTTG from Airmail has got a lot easier. Below is a URL that I use in a ‘Custom Action’ in Airmail to quickly send an email to DevonThink as an HTML file. It does a couple of things - places the senders email address as a link at the top of the email and places a link back to the original email in Airmail. The URL is:


x-devonthink://createhtml?title=[message_subject]&source=%3Cp%3E%3Cstrong%3EFrom%3A%3C%2Fstrong%3E%20%3Ca%20href%3D%22mailto%3A[message_sender]%22%3E[message_sender_name]%3C%2Fa%3E%3Cbr%2F%3E%0A%3Cstrong%3ESubject%3A%3C%2Fstrong%3E%20[message_subject]%3Cbr%2F%3E%0A%3Cstrong%3ELink%3A%3C%2Fstrong%3E%20%3Ca%20href%3D%22[message_linkback]%22%3E[message_linkback]%3C%2Fa%3E%20%3C%2Fp%3E%0A%0A%3Cp%3E[message_html]%3C%2Fp%3E

Thank you for this. Your action works significantly better than the barely useful integration with DEVONthink on the desktop that Airmail provided. This demonstrates that Airmail is more for the iOS platform than macOS

Thank you for this cool tip. I’ve liked to this thread from our blog.

Thanks korm, I agree that the DevonThink action on the Desktop is fairly useless. I have created an applescript that creates an HTML formatted email message in DevonThink on the desktop from the selected email in Airmail. The email includes a URL back to the original message. The scripts are available here: http://eggleton.co.nz/geekposts/2017-02-12-Sending-email-from-AirMail-to-DevonThink/

Second great post of the day. Thanks, Kyle.

Fantastic!

Just a quick note, took me a minute to find it but when I cut and pasted the code for some reason the & became & and DEVONthink failed. Just edit it in the cushion action and change it back to &

Thank you!
Just added the scheme … works perfect :slight_smile:

This pair of scripts is really useful - many thanks

I presume there’s no way of running them such that any attachments remain attached to the message, as opposed to current behaviour, where each attachment is created as a separate item?

I’m sure you investigated this, but thought I’d ask anyway

There is no current way, with the Applescript dictionary available in Airmail, to do this

OK - thank you for responding (and for the scripts, which are a distinct improvement on the native Airmail function)