• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Calling a property by using a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling a property by using a string


  • Subject: Re: Calling a property by using a string
  • From: Philip Aker <email@hidden>
  • Date: Tue, 26 Sep 2006 14:34:12 -0700

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
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:

This email sent to email@hidden

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

  • Prev by Date: RE:AS or Quark cannot count
  • Next by Date: Re: Re: Excel Find an empty cell
  • Previous by thread: Re: Calling a property by using a string
  • Next by thread: Re: Calling a property by using a string
  • Index(es):
    • Date
    • Thread