Re: Scripting iCal. 10.4 and 10.5 UID's incompatible?
Re: Scripting iCal. 10.4 and 10.5 UID's incompatible?
- Subject: Re: Scripting iCal. 10.4 and 10.5 UID's incompatible?
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 29 Oct 2007 20:31:59 -0700
- Thread-topic: Scripting iCal. 10.4 and 10.5 UID's incompatible?
Somebody with Leopard and either Script Debugger or Smile should be able to
tell you what the raw code is for 'uid' - if that property of event still
exists in Leopard. I suspect that it's «ID » (that's two spaces as
characters 3 and 4) and 'uid' is now a synonym for 'id' which compiles even
in iCal tell block in Tiger since it's a property of 'window' in the
Standard Suite. In Tiger the raw code for 'uid' is «wr10» .
The thing to be careful of is that the Leopard 'id' might have a different
structure from the Tiger 'uid'. Get the 'uid' and 'id' respectively in Tiger
and Leopard of an event that was maintained/imported from Tiger into
Leopard. Are they the same?
Even if you don't care (i.e. the script is intended to operate either in one
OS version or the other but not both at the same time nor on calendars moved
to Leopard from Tiger and still checking IDs from Tiger), you'd just need
then some code to check which version of iCal is running and then use the
appropriate raw code for each branch «wr10» or «ID » . Depending on which
OS you're compiling in, one or the other (or maybe both in Tiger) will
compile to 'uid' and 'id' respectively, but will operate appropriately on
both OS's.
To find the "main" version of iCal (corresponding to the OS):
tell application "iCal"
character 1 of (get version) as integer
end tell
If the result is 2 you're in Tiger, if 3 (presumably) you're in Leopard.
Deal accordingly.
--
Paul Berkowitz
> From: John M <email@hidden>
> Date: Mon, 29 Oct 2007 14:20:50 +0000
> To: <email@hidden>
> Subject: Scripting iCal. 10.4 and 10.5 UID's incompatible?
>
> Hi all,
>
> The "uid" property of events in iCal seems incompatible between Tiger
> and Leopard.
>
> Example script:
> --
> tell application "iCal" to uid of event 1 of calendar 1
> --
>
> Compiled under 10.4 and run in 10.5 the following error is generated:
> --
> Can't get «class wr10» of «class wrev» 1 of «class wres» 1 of
> application "iCal".
> --
>
> Compiled under 10.5 and run in 10.4 the following error is generated.
> ("uid" seems to be compiled to "id"):
> --
> iCal got an error: Can't make id of every event 1 of calendar 1 of
> into type reference.
> --
>
> Is it a bug?
> Am I missing something to make this work on both systems?
> Can someone suggest a way of making this script compatible for both
> 10.4 and 10.5?
>
> Thanks & best wishes
>
> John Maisey
> www.nhoj.co.uk
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden