Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Set iChat status based on iCal event alarms' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Set iChat status based on iCal event alarms
Authored by: Guliavan on Jun 20, '12 01:03:08PM

Thanks a lot for this hint. I modified the script a bit to be able to bundle the script and icalbuddy in the same folder w/o having to change the path all the time. Also, I had to set a delay between status and status message change or else the status message wasn't changing... I use on run and on idle events because I saved the script with option to run as background and check every 60 seconds.

--
property scriptPath : null

on run
set d to text item delimiters
set text item delimiters to "/"
set scriptPath to (POSIX path of (path to me))'s text 1 thru text item -3 & "/"
set text item delimiters to d
end run

on idle
set currentPath to (path to me)
set theEventName to (do shell script scriptPath & "/icalBuddy -ic \"My Calendar\" -eep \"*\" -nc -b \"\" -n -li 1 eventsToday")

if (theEventName is not "") then
tell application "iChat"
set status message to "I'm attending " & theEventName & " and I like it."
delay 2
set status to away
end tell
else
tell application "iChat"
set status message to "I'm available"
delay 2
set status to available
end tell
end if

return 60
end idle



[ Reply to This | # ]