How to schedule sending the day’s iCal events via email

I followed this tutorial on creating a workflow using Automator that will email the events of the day from iCal to an email address.

I would like this to be executed every morning at, say 4am, so it is in my inbox when I wake up. What would be the best way to do this? I was thinking of perhaps creating a daily iCal event to execute the workflow, but then wouldn't that event also be included in the email?

Best Answer

The easiest way to schedule a workflow is to use iCal for the scheduling: if you have followed the steps of the tutorial you linked to to the letter and have saved the workflow as an iCal reminder, Automator will have added a new event named like your workflow to a local calendar called “Automator” (creating it if it does’t exist yet). This event has a reminder set to execute the workflow 0 minutes before the event.

To execute it every day on 4 a.m., just schedule the event that way (you could also set it to only repeat on weekdays – or to anything iCal will let you do with a scheduled event). To make sure the triggering event itself is not included, make sure the “Filter iCal Calendar” action (the 1st step of your workflow) excludes the “Automator” calendar – either because filter conditions will bypass it anyway, or by setting a filter condition to “Name is not Automator”.

You can hide the “Automator” calendar from displaying in iCal by unchecking its checkbox in iCal’s calendar list, thus making your workflow execute invisibly for all practical purposes. Also note iCal does not need to run for the event to be triggered, but you must be logged in and the computer should not be sleeping (a workaround for that last gotcha is to set the machine to wake up shortly before the scheduled time in Power Saving System Settings – this would also be necessary if you scheduled with launchd or cron). The actual workflow is to be found in ~/Library/Workflows/Applications/iCal and can be set to a “open file” reminder on any event, should you ever need to do so.