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.
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.
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.
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.
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.
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)
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