Adding emails to DT vs. DTTG....why the different behavior?

When I drag an email in iOS to DTTG the URL begins with “message:”

When I drag an email (or use Message>Add to DEVONthink 3 from menu) in macOS to DT the URL begins with “mailto:”

Why is there this different behavior?

Is there a way for the URL for emails added from macOS to DT to begin with “message:”

The different URL formats behave differently. With the URL beginning with “message:”…I can Open the URL in DTTG (via the Share Sheet) and the email message will open vs. a reply to the original email will open when the URL begins with “mailto:”

FWIW…when you clip an email message into OmniFocus for macOS the URL link for the message begins with “message:”

On the Mac the current behaviour is optimized for (bulk) email archiving. The result does neither depend on the currently used email client nor on the availability of the original message and ensures that emails can be nonetheless still be easily replied to. Actually many users do not keep their emails both in DEVONthink and the email client.

1 Like

Thanks for the quick reply!

My use case is to occasionally archive an individual email associated with a specific project or task for easy retrieval or label it as a “To Do” for future follow up. I use Apple Mail on both macOS and iOS and to not do bulk email archive to DT…perhaps I am in the minority.

Any chance in the future, there could be a setting in DT for macOS to use the same URL format that DTTG uses for adding emails to a database for consistent behavior between the two programs?

Depending on feedback we might add such an option to a future release.

Here you go…

Add message(s) to DEVONthink Message Link.scpt.zip (6.0 KB)

  1. Unzip the attachment.
  2. In the Finder, select the ​Go ​menu while holding the ​Option key​, then choose ​Library​.
  3. Open the /Scripts/Applications/Mail/ directory and drop the script file in.

The script should now be available in the global script menu in the menubar of Apple Mail.

Thanks! That did the trick.

Is there an easy way to assign keyboard shortcuts to the scripts in the global script menu?

Not that I’m aware of at the moment.

Ok didn’t know this was an issue as I use DTTG more than desktop, but I have a similar workflow. Would like to see it added to desktop as well as I don’t do bulk import on DTP

A simple script like this one can change the URL to the desired one:

tell application id "DNtp"
	repeat with theRecord in selected records
		if type of theRecord is unknown and filename of theRecord ends with ".eml" then
			set theMessageID to uuid of theRecord
			if theMessageID contains "@" then -- Is it indeed a message ID?
				if theMessageID begins with "<" and theMessageID ends with ">" then set theMessageID to ("%3c" & (characters 2 thru -2 of theMessageID) & "%3e") as string
				set URL of theRecord to "message://" & theMessageID
			end if
		end if
	end repeat
end tell
1 Like

Sorry I’m probably being slow and not understanding .

How would I use this script? Do I select the email after I’ve imported to DT and then select the script, or is this something that should be done from Mac mail app to import it with the message: component?

Select the imported emails in DEVONthink, then run this script.