Thread-topic: Calling a property by using a string
User-agent: Microsoft-Entourage/11.2.3.060209
On Mon, 25 Sep 2006 11:43:34 -0400, Chris Tangora
<email@hidden> said:
>Hello...
>
>I am trying to get this to work, and I was hoping to have someone
>help me figure out the small detail I am missing. The idea is this,
>take two strings, put them together and have it be the name of a
>previously declared property. Ideally the end result of the sample
>script would be "This Worked", not "Great_Test".
>
>property Average_Test : "Please Don't Work"
>property Good_Test : "Shouldn't Work"
>property Great_Test : "This worked"
>
>set this to "Great"
>set test to "_Test"
>
>set thistest to (this & test)
>
>log thistest
There's no way to do *precisely* what you're describing (the AppleScript
language doesn't have that kind of introspection / dynamism, though many
great languages, such as Ruby, or even ObjectiveC to some extent, do). But
there are plenty of ways to do something similar, such as using records and
Late Night's List & Record tool. There is an example on p. 327 of my book.
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden
This email sent to email@hidden