Automate Out-of-Office Reply Toggling

November 4, 2006

This one actually made it to macosxhints:

If there’s one thing that computers are better at than humans, it’s remembering things. Take for example the typical Out Of Office email reply - you go on vacation and set a rule in Mail.app to automatically respond of your absence to any email with a certain criteria. Then you come back and a day or two later remember to turn the notification back off again.

Well if You use iCal, your Mac most likely already knows when you’re leaving and coming back so let’s simply tie that information with Mail.app. Here’s how:

Open Automator and from the Automator library add a “Run AppleScript” step. Replace the code with the following, putting in the name of your Out of Office rule:

set myRule to "Name of my Out of Office rule"
tell application "Mail"
  set enabled of rule myRule to not enabled of rule myRule
end tell

3) File > Save As Plug-In, give it a name (like “Toggle Out-Of-Office”), Plug-in for: iCal Alarm. Save.

iCal will open with a new event which you can simply delete. Then just create events on the start and end dates of your vacation (if you haven’t already) and set our newly created script as the alarm (which you’ll find in the alarm “Open file” dropdown menu).

The reply will now activate when yo leave and deactivate when you return. Just make sure your rule is Inactive before you go. :)