There are several different ways you can integrate iCal with Indigo Pro, but the most obvious is to have Indigo Pro act on an iCal alarm somehow. Unfortunately, Apple doesn't publish an API for writing custom alarms, so doing this requires some round-about configuration. However, it's completely doable. If you're using Indigo Pro 5 or later, the iCal Alarm Processor plugin is the perfect solution for you. But if you are using an older version of Indigo Pro you can use the script described on this page.
The How-to level of difficulty is Moderate. Note that this requires your Indigo Server machine to be running all the time, and Apple Mail must also be running.
Go to the File Library and download the “iCal Alarm Processor” script. Remember where you save it because you'll need to find it in the next step - I find it handy to just put it in the /Library/Application Support/Perceptive Automation/Indigo 4/Scripts/ folder: that way, it also shows up in the Scripts
menu item in Indigo (if you're running the Client on the same machine as the server).
By default, this script will have your Mac speak the Name of the event and what time it starts through your Mac's built-in speakers (if you're using Airfoil, it will get redirected wherever you have Airfoil set as output). It can also execute an Action Group whenever an Alert Email is received.
There are four properties at the top of the script that you should pay attention to:
[Set Variable] varname1goeshere=variable 1 value here varname2goeshere=variable 2 value here [Execute Actions] group=Action Group 1 Name here tdaction=Time/Date Action Name here trigger=Trigger Name here
Note the formatting: the directive name is enclosed in square braces on a separate line directly followed by name=value pairs. For the Set Variable directive, the name of the variable is first, the value of the variable is second. For the Execute Actions directive, the name is one of 3 options: “group” for an action group, tdaction for a Time/Date Action, or “trigger” for a Trigger. The value is the name of the item. I've broken Set Variable out from Execute Actions in terms of activation - the thinking is that setting a variable is (potentially) less of a security risk han executing an action. NOTE: After all of the directive name/value pairs, there must be a blank line.
OK, now that you know what you need, you have the script file ready, and the mail account has been created, here's the step-by-step instructions to perform in Indigo:
Server Preferences…
from the Indigo menuEmail
tabCheck email every
and specify how often you want to check for new iCal AlarmsOK
TRIGGERS
from the outline view on the leftNew…
buttonEmail Received
from the Type:
popupOnly if:
radio button (so that it will only trigger when we get an Alarm email from iCal)subject contains:
checkboxsubject contains:
(don't include the quotes). When iCal sends an email Alarm, the subject line always starts with “Alarm -” so that will be our triggerActions
tabExecute AppleScript
from the Type
popupFile:
radio button is checkedChoose…
button next to File:
, and select the script you just saved.OK
buttonEmail
and set the address to the address book entry that you want to use (the same one that you configured at the top of this How-To in Mail)
That's it! Next time iCal sends out a reminder for an event, Indigo Pro will get it and perform whatever actions you want. Note: the AppleScript above could, in fact, get the entire iCal entry and all it's parts and do much more complex things. If you're interested in learning more about AppleScript, we'd suggest you get AppleScript: The Definitive Guide, 2nd Edition by Matt Neuburg. It's a very good overview and reference in one book.