reload ical calendars from file with ical open

I have a separate application that generates a .ics ical file, and everything works great with the syncing to iCal EXCEPT that if iCal is open the information will not be shown until the next launch of iCal. I’ve tried using:

tell application "iCal"
	reload calendars
end tell

but that does nothing. I’ve also tried manually right clicking on the calendar list and selecting refresh all, but that does nothing.

Is there any way to update the calendar without forcing iCal to quit and then relaunch?

Thank you.

Hi mjdth,

Here’s a workaround ui scripting iCal’s ‘open’ command.

set f to choose file – the .ics file
set f_name to name of (info for f)
– remove the extension
set rev_string to (reverse of (characters of f_name)) as string
set o to (offset of “.” in rev_string)
set cal_name to (reverse of (characters (o + 1) thru -1 of rev_string)) as string
tell application “iCal”
– first set focus on a new calendar
make new calendar with properties {title:cal_name}
– don’t wait for reply, so script can continue
ignoring application responses
open {f}
end ignoring
end tell
tell application “System Events”
tell process “iCal”
repeat until exists window “Add events”
end repeat
– click or keystroke
tell window “Add events”
click button “OK”
end tell
end tell
end tell