While the holiday season can bring both comfort and joy, it can also be one of the most hectic times of the yearone where you may be so distracted by one task that you neglect another. Take those holiday well-wishes that many of us email to friends, family, and business associates, for example. All too often we leave them to the last minute and, worse, remember them only when were on the road to grandmas without laptop or Internet connection.
Not only can you compose your season's greetings weeks before the holidays, but you can schedule when theyre sent, thus ensuring that they hit your loved ones inboxes at the perfect moment. The means for doing this is OS X's Automator. Here are the steps for creating and automatically sending your holiday email messages with Mountain Lion.
Begin your festive workflow
Launch Automator (in your /Applications folder) and from the workflow template chooser select Calendar Alarm and click Choose. From the Library pane at the far left of the workflow window, select Mail and drag the New Mail Messageaction to the workflow area to the right.
in the Library pane, select Files & Folders and drag the Get Specified Finder Items action to that same workflow area. Select Mail in the Library pane and then drag Add Attachments to Front Message action to the workflow. Click on the Utilities item in the Library pane and drag Pause to the workflow. And finally, from that same Utilities library, add Run AppleScript to the workflow.
Put the actions in action
What have you done exactly? Lets walk through the actions.
The first action will create a new message in Apple's Mail application. Into this action you want to add those people to whom youll send your greeting. You can manually enter their email addresses into the actions To field, or click on the Contact button (it looks like a Rolodex card) and add contacts stored in the Contacts application.
In the Subject field enter an appropriate title for your messageHappy Holidays! while trite, gets the idea across quite well. Enter something jolly in the Message field and from the Account pop-up menu choose the email account youll send the message from.
The second actionGet Specified Finder Itemstells the workflow the location of the appropriately cheery image you intend to add to your email message. Locate such an image on your Maca picture of the family, a snowy landscape, or flying ungulates, for exampleand drag it into this action. Note that this image will not be resized when sent. You need to manually resize it so that its not so enormous that your email gateway rejects it. You can do this within Apple's iPhoto by selecting an image, choosing File > Export, and in the File Export tab, choosing Mediumfrom the Size pop-up menu. Click Export and save the image to the desktop, for easy dragging to your workflow.
The third action, Add Attachments to Front Message embeds the image into your message.
The Pause action is something of a workaround. In our final stepthe AppleScript actionwere going to tell Mail to send the message. But without adding a brief pause between adding the attachment and initiating that AppleScript, the message is sent without the image. So, were giving Automator the time it needs to complete all of its actions. Ive found that a 2-second pause is enough.
And finally the AppleScript. This tells Mail to whisk the message to your holiday pals. The AppleScript to use is:
tell application "Mail" to activate tell application "System Events" click menu item "Send" of menu "Message" of menu bar item "Message" of menu bar 1 of application process "Mail" of application "System Events" end tell
This AppleScript will work only if youve configured your Mac's Accessibility system preference correctly. To do so, launch System Preferences, select Accessibility, and enable the Enable Access for Assistive Devices option. (You'll need to enter your administrator's password.) When you do this, AppleScript is able to issue Mails Send command.
Schedule your greetings
Youre nearly done. Now choose File > Save. When you do the Calendar application launches and, if one doesnt exist, an Automator calendar is created. The workflow you just assembled appears as an event. Move that event to the day when you wish to send your message. Click on it, press Command-E, and then enter the time youd like the message to be sent. Click Done and go about the rest of your holiday business. The message will be sent as configured.
Spread cheer from pre-Mountain Lion Macs
Ive taken pains to say that this workflow is for Mountain Lion. You can do this in earlier versions of the the Mac OS as well and, at least in the case of Snow Leopard, it can be easier.
With Snow Leopard you can dispense with the Pause and AppleScript actions and instead insert the Send Outgoing Messages action. Under Mountain Lion this action doesn't work within this workflow as it should. If you try to use it the message will stay front and center in Mail and wont be sent. It behaves properly under Snow Leopard.