I have a big list where every item in the list is itself a list, like so:
{{title, start date, end date, category}, {title, start date, end date, category}, {title, start date, end date, category}} (etc.)
I want to populate an empty iCal calendar with this information.
I broke the list of events down by category, so now I have 18 different lists, each with events that belong together.
Here's what I've been doing:
tell application "iCal" set theCalendar to make new calendar with properties {title:the_name} --the_name is the name of the category tell theCalendar repeat with j from 1 to the number of items in the_cat_events -- the_cat_events is the list holding the events make new event at end with properties {summary: item 1 of item j of the_cat_events, start date: item2 of item j of the_cat_events, end date; item 3 of item j of the_cat_events. end repeat end tell end tell
it works, but it's slow. My list of events is 13,000 events long. For 100 items or so it's pretty quick but with this many items it's taking forever. I have a feeling that it actually slows down the longer it runs.
It's taking hours. Actually, overnight. Somehow I think there's a more efficient way. I would appreciate your suggestions. Thank you.
Running on 10.6.3, iCal 4.0.2.
Christian Boyce |