Re: Property questions
Re: Property questions
- Subject: Re: Property questions
- From: Timothy Bates <email@hidden>
- Date: Fri, 16 Feb 2001 13:26:47 +1100
On 2/16/01 9:25 AM, "David Reynolds" <email@hidden> wrote:
>
is it possible to reference a property label through a variable?
>
property myProp {lable1:1, label2:2, label3:3}
>
set foo to "label1"
>
set foo of myProp to 2
>
I want it to look for the label *contained* by foo in myProp.
Sorry: you can do this easily in Php, but it is impossible in AppleScript.
In php what you do is say (mixing AS and Php syntax).
set $foo to "label1"
set $$foo of myProp to 2
The double "$" at the front says "the variable named by this variable"
In AS, you need to know the name of all variables ahead of time, they cannot
be created on the fly.
tim