Keyboard Maestro Macro: Attach and Send

I’ve long had a need to take a file sitting on my computer and send to to someone. While you can do that with the share menu on OS X, it’s not that great for a couple of reasons:

  1. It’s a menu item you have to click.
  2. It doesn’t, and can’t, set simple things like the to, subject, bcc, and sending email account.

Those are items I always need to change — so I’d like to be able to set those to a keyboard shortcut for faster sending of files. Additionally I have PDFs that I email monthly, to the same people, with just the date in the subject changing (and the PDF) — it’d be great to automate that too.

What I have come up with in Keyboard Maestro (hat tip to this post from Viticci) is a macro that does just that. More so than any of my other macros, this macro heavily relies on AppleScript to get the job done.

What this macro is doing is using Keyboard Maestro to pass variables to an AppleScript. I pass the date, because I simply couldn’t figure out how to get todays date formatted the way I wanted it in AppleScript. You will also notice a blank variable for the recipient email address — I use that in later macros and it was easier to keep in than remove.

The heart of the macro is this AppleScript:

Screen Shot 2013-08-15 at 4.44.13 PM

(Download the script here.)

At my office we BCC all communications to Highrise, and so you can see the address for that on the BCC line. I also set the sender in the AppleScript, but if you wanted to you could set that with a Keyboard Maestro variable just like I have for the recipient and subject lines.

With that all setup, and the basic macro in place, I just duplicated the macro for each group of people I wanted to send an email to. Pasted their address in the macro variable box for addresses, and modified the subject variable as needed.

In all I have 14 different file emailing macros. All stored in one group and activated with the same hotkey. You can select as many files as you want and they will all be attached — this saves me a ton of time each month.

Become a Member

This site is 100% member supported and free of advertising. Members receive access to exclusive weekly content: iPad Productivity Report, videos, and the best products listing.

Join Now

Already a member? Please sign in.

Article Details

Published
by Ben Brooks
2 minutes to read.


tl;dr

I’ve long had a need to take a file sitting on my computer and send to to someone. While you can do that with the share menu on OS X, it’s not that great for a couple of reasons: It’s a menu item you have to click. It doesn’t, and can’t, set simple things like […]