Looking for a script for sending a mail automatically

Hello all,

I’d like to send a mail to a predefined recipient, whenever I add a document to a specific group/folder.
Could anyone please tell me, whether (and how) this is possible by using AppleScript?

Thanks for your answer.
Regards
Alex

Though it is possible to attach a script to a DEVONthink group, you should be aware that the script does not execute unless the group is selected (clicked). DEVONthink is not monitoring groups looking for changes that will trigger a script.

But, a Folder Action attached to a folder in the file system will monitor. It’s a simple matter to create a Folder Action using Automator that sends an email when a document is added to the folder – here’s one of dozens of recipes locatable on the net. If you index that folder in DEVONthink you’ll be able to work with the contents in DEVONthink also.

If you want to create your script as a triggered script in DEVONthink (a triggered script is what DEVONthink calls a script that can be attached to a group), then be sure to wrap the code in this statement


on triggered (theRecord)
[code stuff that sends emails]
end triggered

Also, note that AppleScript for Mavericks Mail is seriously broken – referring here to Mail’s interaction with Gmail and AppleScript’s interaction with Mail + Gmail.

Ugh! :imp:

Hello korm,

thanks very much for your reply. Using Automator for this is a good idea.

Best regards
Alex