List Events and Todos of Calendars
I like how Applescript allows for quick solutions to what otherwise would be tricky problems to solve. Take the total number of events in an iCal calendar, this is a question asked recently on Apple Discussions. Counting them by hand would be a bore (especially with 40,000), but with Applescript it's as easy as:
tell application "iCal" to count events of calendars
(gives the result of 1279 currently for me.)
Simple, but what is in your 'home' calendar? How about the other 20 calendars you have? Let alone todos.
Here is a short Applescript for you to try. It displays the total of events and todos for each iCal calendar. The result can be copied to the clipboard.
You can download this script complied as an application here.
-- List Events and Todos of Calendars -- John Maisey -- <a href="http://www.nhoj.co.uk" title="www.nhoj.co.uk">www.nhoj.co.uk</a> -- 19 June 2010 & 13 July 2010 set myText to "Count of events/todos in iCal's calendars." & return tell application "iCal" repeat with myCal in calendars set myText to myText & return & (name of myCal) & return & tab & (count events of myCal) & " events & " & (count todos of myCal) & " todos" end repeat end tell display dialog myText buttons {"Copy to clipboard", "OK"} default button 2 if button returned of result is "Copy to clipboard" then set the clipboard to myText end if
Suggestions, corrections, improvements? Comment below.


