Integrating DT3 with Outlook

I would like to ask if there was an option to send emails to DT3 or integrate a DT3 email clipper to microsoft outlook.

The wish list is to be able find emails easily and efficiently.

Would like to learn from you all whats the way forward.

p.s. the last I seen was in 2019 when it is not possible.

There is no specific plugin for Outlook. However, it is supported for email importing and mailbox archiving in DEVONthink’s View > Import sidebar.

However…

  1. You must enable Full Disk Access and allow DEVONthink’s Automation requests in System Preferences > Security & Privacy > Privacy.

  2. We provided some AppleScripts for use in Outlook, accessible via the global script menu in the menubar at the top of your screen.

  3. You need to be running the classic interface in Outlook in order for our AppleScripts to be used. Microsoft broke inter-application communication with their New Outlook interface.
    When you switch back you should be prompted with a dialog asking why you are switching back. Please select the AppleScript option and comment you need AppleScript support in the new interface. Hopefully enough people will comment and Microsoft will fix the issue.

2 Likes

Hi there, thank you for your reply - can I ask which folder is doing this and how do you apple script it ?This is my first time executing an apple script and I worry I might do something wrong by clicking it.

The global script menu is in the menu at when you’re in the other application, in this case Outlook.

As of now, using Microsoft Outlook for Mac 16.88, I think the most efficient way to save emails from Outlook to DEVONthink is by printing (⌘P) and then selecting “Save PDF to DEVONthink 3” in the drop-down menu on the bottom left corner of the print dialog box. It is quick.

If more than one email is selected, the selected emails will be merged into a single PDF.

For my purposes the output is certainly usable, and most importantly, searchable.

If someone is aware of a better or different, current solution, I would be interested to know.

Just drag and drop one or multiple emails from Outlook into DT3 until the + sign appears when you hover over the name of the Group you want to import th email to go into.

Or drag and drop one or more emails into the FInder destination of your choice - which could be the Devonthink Inbox folder or a watched Hazel folder or whatever else you prefer.

1 Like

Just drag and drop one or multiple emails from Outlook into DT3 until the + sign appears when you hover over the name of the Group you want to import th email to go into.

As always before, dragging an email from Outlook into a DT3(pro) Group yields an “Item does not exist” error in the log, for me. I didn’t think it was possible. Is there a configuration trick? (I imagined that I was running into the limitation described above in the thread, that Applescript doesn’t work with the current Outlook interface.)

1 Like

Might it be the other way around and you are trying to import an email that DOES already exist? That can be a problem.

The emails, arriving as I’m typing, aren’t already in DT3. But though I can’t drag from Outlook to DT3, your second suggestion works, to drag from Outlook into the Finder and then from the Finder into DT3. And it’s a clever idea to drag them to a folder that Hazel is watching!

2 Likes

Good to hear.

If that works then you may like the script I use for importing into DT3 from Hazel:

tell application id "DNtp"
	set newFile to import path (POSIX path of theFile) to display group selector
	set {recName, recURL} to {name, reference URL} of newFile
	if (exists newFile) then tell application "Finder" to delete theFile
end tell

Moreover you then have the question of whether you want to keep attachment in the .eml file or to import all attachments into DT3. That is an option in your DT3 configuration.

I choose to only selectively import the attachments as separate files. I keep the attachments in the .eml file. But when I do want to import them to DT3 this is a helpful script which I adapted from another post here. It creates a new group conttaining the email message and its attachments:

tell application id "DNtp"
	set theSelection to the selection
	set tmpFolder to path to temporary items
	set tmpPath to POSIX path of tmpFolder
	
	with timeout of 14400 seconds
		repeat with theRecord in theSelection
			if type of theRecord is unknown and path of theRecord ends with ".eml" then
				set theRTF to convert record theRecord to rich
				set theURL to reference URL of theRecord
				set newGroup to false
				
				try
					if type of theRTF is rtfd then
						set thePath to path of theRTF
						set theGroup to parent 1 of theRecord
						set theName to name of theRecord
						set theModificationDate to the modification date of theRecord
						set theCreationDate to the creation date of theRecord
						set theAdditionDate to the addition date of theRecord
						
						tell text of theRTF
							if exists attachment in attribute runs then
								
								tell application "Finder"
									set filelist to every file in ((POSIX file thePath) as alias)
									repeat with theFile in filelist
										set theAttachment to POSIX path of (theFile as string)
										
										if theAttachment does not end with ".rtf" and theAttachment does not end with ".png" then
											try
												with timeout of 7200 seconds
													
													-- Importing skips files inside the database package,
													-- therefore let's move them to a temporary folder first
													
													set theAttachment to move ((POSIX file theAttachment) as alias) to tmpFolder with replacing
													set theAttachment to POSIX path of (theAttachment as string)
													tell application id "DNtp"
														if newGroup is false then
															set newGroup to create record with {name:theName, type:group, modification date:theModificationDate, creation date:theCreationDate, addition date:theAdditionDate} in theGroup
														end if
														set importedFile to import theAttachment to newGroup
														set URL of importedFile to theURL
														set the modification date of importedFile to theModificationDate
														set the creation date of importedFile to theCreationDate
														set the addition date of importFile to theAdditionDate
														
													end tell
												end timeout
											end try
										end if
									end repeat
									
								end tell
								if newGroup is not false then
									tell application id "DNtp"
										move record theRecord to newGroup
									end tell
								end if
							end if
						end tell
					end if
				on error msg
					display dialog msg
				end try
			end if
			
			delete record theRTF
		end repeat
	end timeout
end tell

on makeDate(dateString)
	set theDate to date dateString
end makeDate
3 Likes

This is worth keeping current as a topic. Are you saying that you are forcefully telling Hazel to slay DT into importing emails as individual EML files ?

Not sure I would be that dramatic :slight_smile: but yes Hazel does a great job importing into DT individual email files which I download from my webmail. It works great.

1 Like