Folder Trigger to create macro that sends new files to client with Apple Mail

Hey guys. I am trying to set up a macro that is triggered whenever a new file is added to a client folder. Once that happens I need the macro to copy the new file that was added (the trigger) and attach that to a new email message using Apple Mail, and send it out without me having to do anything. I'm going to blind copy myself on the emails to have a record of what was sent to the client. Can anyone help me out? Full disclaimer, I am very new to Keyboard Maestro, and most of this is over my head. Thanks for any help you can provide.

Hi Martin,

Fortunately, this is easier than you might think. Start by modifying this sample macro and see if you can't get it to work for you. Make sure to replace the parts [WRITTEN LIKE THIS] with the appropriate values, and also note that it's set to use the file's name for the subject by default. If that's not needed or helpful, feel free to remove the initial Get File Attribute action and erase the %Variable%LocalFileName% variable from the subject field and replace it with a subject of your choice.

Example Macro.kmmacros (2.2 KB)
image

Thanks for responding so quickly. I'll give it a shot.

The macro works to create a new mail message. It includes the text in the message, and attaches the correct file. Only problems I am having now is that my signature will not show up. I have changed the selection in the macro to default, and double checked the preferences in Mail to be sure that my work email signature is designated as the default for that account. Any suggestions, other than selecting it myself once the email is generated? Also, I have an AppleScript that will type the contacts first name in the body of the email. Is there any way to run that with this macro?

Glad to hear it!

Why not recreate, or even just copy and paste, the signature you want to use into the body field for the macro?

Possibly (it's hard to say without seeing the script itself) but if you know that you'll be sending to the same client each time, why not just include their name in the body too? Example that includes the signature suggestion:

image

Very valid suggestions. I am embarrassed that I didn't think of it. Thanks again.

1 Like

Hey Guys,

AppleScripted Signatures are broken in Apple Mail since Yosemite (if I remember correctly), and Apple in their infinite wisdom has chosen NOT to fix them. (Bad Apple!)

So Gabe's solution is probably the best one at this time.

NOTE – Keep in mind that Keyboard Maestro's Send Mail Message action can only send one file – it cannot manage multiple files.

This would appear to be fine for Martin's task at this time, but should that change please see post #2 in this topic:

Mail ‘Attach’ multiple items

-Chris

1 Like