Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling a property by using a string



On 2006-09-25, at 15:18:07, has wrote:

AS doesn't provide an associative array type as standard,

However folks can get by using System Events property list items:

tell application "System Events" to activate
tell application "System Events"
set p1 to make new property list item with properties {kind:string, name:"mlle", value:"Jones"}
set n1 to "ml"
set n2 to "le"
set n to n1 & n2
set val to value of (item 1 of (every property list item whose name is n))
end tell
tell application "System Events" to quit
tell me to activate
val

--> "Jones"


unfortunately,

as you can see from the above, it's implementation leaves something to be desired because if one runs the script multiple times,

every property list item

returns the accumulated sum of every property list item created.

Philip Aker


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden

References: 
 >Re: Calling a property by using a string (From: has <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.