Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question
    
You never heard of crontab?! –  XQYZ Oct 30 '11 at 20:03
    
0 4 * * * tyre77 ~/Documents/DailyiCalEmail.workflow Will this execute the file correctly or do I need to specify for Automator to run it? –  Chris Oct 30 '11 at 20:49
    
cron is deprecated by launchd if you want to go that route, but, more importantly, this won’t work – it will just open the workflow for editing in Automator. –  kopischke Oct 31 '11 at 7:17
    
The second part of your original question would be better handled by another question – Ask Different works best when a question addresses one precise issue. The “send ICS” part in particular is not quite straightforward to solve as neither Automator nor iCal’s AppleScript dictionary provide means to export events. There are somewhat messy workarounds using GUI scripting, but as noted, this really belongs into a different question. –  kopischke Oct 31 '11 at 11:00
    
What kind of Calendar service? iCloud, Gmail, or local? –  Bradley Chambers Oct 31 '11 at 11:03
show 2 more comments

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
So I have created the event. One of the options for the alarm is to run a script, but when I go to the workflow it is greyed out. If I just open the file it won't actually run. How do I get around this? –  Chris Oct 31 '11 at 13:50
    
Actually, the event should have been created for you when you saved your workflow. Didn’t you select “iCal Reminder” when Automator prompted you what kind of workflow to create? If you saved it as an ordinary workflow, you will have to save it as a reminder again (File » Duplicate on Lion, create again on Snow Leopard). If it is saved as a reminder in the correct folder, using “open file” for the notification will run it, not open it (iCal handles that). –  kopischke Oct 31 '11 at 15:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.