Re: Moving events between calendars in iCal
Re: Moving events between calendars in iCal
- Subject: Re: Moving events between calendars in iCal
- From: John M <email@hidden>
- Date: Tue, 31 Jan 2006 19:29:55 +0000
Hi Sweth,
The script below duplicates all the properties from the first event
in one calendar to another calendar. (note the workarounds to deal
with unexpected undocumented behaviour). Have you looked into which
properties of events in iCal's Applescript Dictionary are read only?
--
set sourceCal to "Home"
set destCal to "test"
tell application "iCal"
set evtProp to properties of event 1 of (first calendar whose name
is sourceCal)
--for iCal Frequency bug in OSX 10.3
if recurrence of evtProp is not "" and recurrence of evtProp starts
with ":" then set recurrence of evtProp to (characters 2 thru -1 of
recurrence of evtProp) as text
--for all day property bug in OSX 10.3
if allday event of evtProp is true then set end date of evtProp to
(end date of evtProp) - 2 * hours
-- Make the new event
set myNew to make event at end of events of (first calendar whose
name is destCal) with properties {location:location of evtProp,
url:url of evtProp, end date:end date of evtProp,
recurrence:recurrence of evtProp, summary:summary of evtProp, start
date:start date of evtProp, excluded dates:excluded dates of evtProp,
description:description of evtProp, status:status of evtProp}
--For some reason this cannot be added to the properties straight
away (otherwise all day events end up a day short (10.3 & 10.4) -
probably a bug)
set allday event of myNew to allday event of evtProp
end tell
--
John M
Sweth Chandramouli wrote (Tue, 31 Jan 2006 09:20:52 -0500):
is there an easy way to copy all of the properties from one event
to a new one, either in one fell swoop or by a loop iterating
through all of the properties for the event class?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden