Dec 02, '09 07:30:00AM • Contributed by: Andrew J Freyer
First, save this as a script in AppleScript Editor. I have saved it as iCal Event to iChat:
set theEventName to (do shell script "/usr/local/bin/icalbuddy -ic \"Some\ Calendar\" -eep \"*\" -nc -b \"\" -n -li 1 eventsToday") if (theEventName is not "") then tell application "iChat" set status to away set status message to "I am attending " & theEventName & "." end tell end if
The reason that the alarm should be set after the event begins is that the return value from iCalBuddy is the current or next event. Therefore, if two events are immediately sequential, a "before" alarm will set the iChat status as the title of the current event, not the event that is actually calling the script.
If You are using Chax and Snow Leopard, use this code:
set theEventName to (do shell script "/usr/local/bin/icalbuddy -ic \"Some\ Calendar\" -eep \"*\" -nc -b \"\" -n -li 1 eventsToday") if (theEventName is not "") then tell application "Chax" to activate delay 2 tell application "iChat" set status to away set status message to "I am attending " & theEventName & "." end tell end if
