AW2307
April 8, 2022, 2:05pm
21
DTLow:
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)
Thank you very much for sharing this script @DTLow !
I was looking for a way to fully automate adding emails from a certain folder to DevonThink, and this solution works flawlessly in combination with KB Maestro.