I use MailTags heavily with Apple’s Mail.app. I’ve had no trouble using the Devonthink mail conduit to add email into a database. Let’s say I have email tagged with either a project or a keyword. It’s simple enough to make a smart mailbox for this and add any messages I want, by hand to the devonthink database.
What I would like to do is somehow automate the process of an applescript which either runs automatically every 24-36 hours (or whatever time interval I set), and then takes all the messages tagged with @projectName or @Keyword, and adds them to a devonthink database/directory of my choice, IF THEY ARE NOT ALREADY PRESENT.
I don’t want endless duplicates, I would just like to be able to find any pieces of email that pertain to a specific project or keyword, and file them into whatever database/directory I want to store them in, inside devonthink, without creating duplicates, replicants or copies of them (the script won’t keep re-importing the same messages over and over, just the new ones, since the last time it was run).
If this script could run automatically that would be great, if that’s too complex and it’s something that I could just map to a MailActOn rule, that’s equally alright.
I am essentially looking for something to simplify the process of manually selecting mail to add to devonthink and automating the task, if it contains a keyword, project (some mailtag data or message date) that I want.
How would I go about doing this? Is it possible? It seems like it should be. There is another mailbox database whose name escapes me at the moment, which features an automatic sync that does exactly this (copies over any new message that fit a certain criteria, to the database, every X hours).
Thank you for any insights.