There are tons of posts regarding email->DT. Mostly on importing at once. However I haven’t found anything on my concern:
Is it possible to push emails to (a not running) DT when they get put into a specific folder within the Mail app?
As Apple mail rules only trigger on incoming mails, this way seems to be blocked.
I’am happy for any suggestions! I’am also open to different approaches along the way: Select email in Apple Mail and trigger import to a not running DT.
I know I could use drag’n’drop to the DT sorter. But this forces DT to be running.
Your question to me sounds like you want to import a certain e-mail only when you perform a move action in Mail. But to what extent?
The reason I’m asking is that I think you’ve thought up a workflow to reach that goal, but it might be you can reach that goal with another workflow as well. That’s also what you’re refering to I guess with the sentence:
I understand running DT is a limitation. Why is that?
How about File/Save As (pick an option, I just tested “Raw Message Source”) to the DEVONthink Public Inbox Folder. Or create a PDF from the mail. I put a few there and then when DEVONthink launched later, all files were imported to the Global Inbox?
As @rmschne mentioned, the Global Inbox functions that way as it will hold data until DEVONthink is running.
@pico_prob
You can’t run mail rules based on items going into a folder in Mail. There is no criterion for that.
If you’re going to file items in a folder to sequester them for inspection, you can select them and use the mail script via the script menu in the menubar to send them to DEVONthink as needed.
The closest I get so far is:
Drag’n’Drop email or its attachment to the DT inbox in the finder.
Does anybody know some shortcut for this? A quick look into Apple Automator looked promising: There’s an element to save mail attachments to disk. However, I couldn’t find anything on how to save the mail (ie text) itself… Any hints?
Is there a keyboard shortcut (3rd party?) to trigger an automator script? I guess I can google this easily, but any well-proven solutions?
I’ll look into this tomorrow or on the weekend and keep you posted
Goal: to easily import selected email (or emails) in Apple Mail into specific places in DT. I do this because I like to group project files together including emails that are associated with that project.
Set up:
Ensure that the Apple Mail Plugin from DT is installed. Devonthink 3>Install Add Ons...
Create a keyboard shortcut for the new DT menu item in Mail.app (i.e. Message>Add to DEVONthink 3). To do this:
a. Go to your Mac system preferences, choose Keyboard then choose Shortcuts>App Shortcuts.
b. Click the + to add a new shortcut. Select Mail.app.
c. In the “Menu Title” add Add to DEVONthink 3. (note this has to match the menubar item and it has “DEVON” in all caps).
d. Add your shortcut. I use CTRL+OPT+CMD+D.
e. Now, in Mail.app on the menubar click on Message and check that the correct shortcut has been applied.
In Devonthink, go to Preferences>Import and check “Select group” for Destination.
Use:
In Mail.app, if you want to save the current email that is highlighted, just use the keyboard shortcut, then when the popup appears, CMD-F to jump to the search box to find the group you want it in (TAB to exit search so you can use the arrow keys to select if needed). Hit enter and it’s done.
Where you view mail in threads and have “show related email” enabled, note that selecting a thread will save all the incoming mail but not the sent ones (i.e. the ones you sent in the thread). To save the sent emails, double click on the sent mail to launch it in its own window and use the keyboard shortcut. CMD-W to close the sent email window when done.
Bonus
Mail that is imported handily has the date created as the timestamp of the email message. You could stop there, but I like to rename my emails so it starts with the timestamp, e.g. “2021-01-12 1123 Our scheduled meeting”. I have been labelling all my files this way for decades – it’s useful if you sort by name.
To do this, create a new smart rule in DT that gets activated on the import of an email message.
It requires DT running, however this is some fine technique you have there, @Luminary99_0! Thank you for the time you put into this post. I am very grateful.
Could you elaborate a bit on your smart rule? I am just discovering the DT world…
BTW: I needed to restart Apple Mail to obtain the shortcut. As your instruction is very detailed, you might want to add this for others.
I was interested in this discussion because I have a similar setup
I move specific email to my “Devonthink” apple-mail folder (Mac, iPad or mail rule)
I also use DT’s excellent Add message(s) & attachments to DEVONthink.scpt
To trigger the import to DT, I wrote this script
It acts for each email in the mail import folder
set MailScript to (load script "/Users/DTLow/Library/Scripts/Applications/Mail/Add message(s) & attachments to DEVONthink.scpt")
tell application id "DNtp" to set theGroup to preferred import destination
tell application "Mail"
set theFolder to (POSIX path of (path to temporary items))
set TheMessages to (messages of mailbox "Devonthink" of account "iCloud")
repeat with theMessage in TheMessages
MailScript's imPortMessage(theMessage, theFolder, theGroup)
delete theMessage
end repeat
end tell
This trigger script can be run manually, but I automated it to run every 5 minutes (Keyboard Maestro)
At bottom left of the sidebar there is a gear icon, click that and choose New Smart Rule.... A pop up will appear.
Give it a name, e.g. `Process email names to include date-time’.
Search in: Databases. Leave all check-boxes unchecked.
Rule: All of the following is true:
[Kind] [is] [Email]
Perform the following actions: [On Import]
[Change Name] to:
[Sortable Creation Date] [Name]
(in order to to get the tokens above you need to right-click (or CTRL-click) in the input space after the word “to” and choose Insert Place Holder > and select the tokens. There are many to choose from.
i would like to adopt your workflow - this is great. However, I can’t find the script “Add message(s) & attachments to DEVONthink.scpt” in DT, doesn’t seem to be reloadable either. Can you please tell me how to get to the DT script. Thanks. Otto
After installing additional scripts via DEVONthink 3 > Install Add-ons… it’s accessible via the system-wide Scripts menu extra when Apple Mail or Microsoft Outlook is the active application.