99% there! But this question sort of feels like a potential bug in
Apple's stuff.
If I have an "allday event" then the "start date" property on the event
is one day before what I expect. So when I do a strict copy, the event
gets one day longer.
i.e.
If I have Christmas set as an all day event on "December 25", when I do
set oldStartDate to start date of oldEvent
It gets set to 4:00pm December 24.
So when I create the new event, it now spans from December 24th -
December 25th and has become two days.
e.g. Here's a script that creates an all day event for today (Thursday,
January 15th), but when I get back the start/end dates, the start date
is a day off (Wednesday, January 14th). Is that expected behavior?
----
tell application "iCal"
set testCalendar to ¬
(item 1 of (every calendar whose title is "Test"))
make new event at end of testCalendar with properties ¬
{end date:current date, ¬
start date:current date, ¬
summary:"Growing Date", ¬
allday event:true}
set myNewEvent to last event of testCalendar
display dialog "[" & (start date of myNewEvent) & ¬
"] to [" & (end date of myNewEvent) & "]"
end tell
----
>> Stay informed about: Changing Events to different Calendar in iCal