I’ve been keeping notes on a recurring event but am seeing iSync randomly lose the notes (I use .Mac iSync between my Mac Book Pro and my Mac Pro). Since I need the notes for an ongoing legal issue loosing them is creating a problem. Looking through the iCal dictionary “Notes” doesn’t appear to be a valid field, searching around I’ve found that possibly the “Description” and /or “Summary” fields may contain the information. I’m a relative noob with Applescript and don’t have much time in the next couple weeks to learn the finer points. Any assistance would be greatly appreciated!!
tia/
I’m not sure you can recover notes from a recurring event. iCal only keeps one copy of recurrent events in its database and information for the recurrence. If an event is recurrent, then the summary of the event contains parentheses, and between them is the number giving the frequency of recurrence.
I use that to recover recurrences in one of my calendars on which the repeat is 4 weeks:
set today to (current date)
set sDate to short date string of today as string
set wDay to weekday of today
-- Build the Medical List "MAppt" {name, date, name, date, ...}
tell application "iCal"
-- find the calendar
set MCals to every calendar whose title contains "Medical"
-- there's only one, but it's in a list
set mCal to item 1 of MCals
set toGo to {}
-- Collect the date/name list as mdCal
set mCount to count events of mCal
set mdEvent to {} -- place holder for events
set mdDate to {} -- place holder for dates of events
repeat with n from 1 to mCount
-- Get summary and start date of each
tell event n of mCal
set {anEvent, aDate} to {summary of it, start date of it}
-- test for recurrence
if anEvent contains "(" then
set paren to offset of "(" in anEvent -- find the left paren.
set Rep to character (paren + 1) of anEvent -- get the next character
-- Now find the next occurrence after today
tell (Rep * weeks) to set aDate to today + (it - ((today - aDate) mod it))
end if
end tell
if ((aDate) - today) > 0 then
set end of mdEvent to anEvent
set end of mdDate to aDate
end if
end repeat
end tell
-- my routine then sorts the two lists by date and presents them in a Growl notification, but at this point you have two lists: one of events, the other of their dates if they are after today.