User Tools

Site Tools


dictionary:more:valueforkey

This is an old revision of the document!


Table of Contents

Value For Key

The value for key verb accepts an AppleScript user record and a text key and will return the value in the record that contains that key. Since user records use hard coded keywords usually there is no built in AppleScript way to get the value out of a record if you don’t know the key at compile time without using this verb. This only works on user created records with text keys and not with records for which the keys are enumerated in the scripting dictionary.

Example:

set myRecord to {myname:"James", height:"6 foot 4 and a half", shoesize:"extra large wide"}

write log (value for key myRecord key "height”)

will write “6 foot and a half” to the log.

See Also:

dictionary/more/valueforkey.1587994781.txt.gz · Last modified: 2023/02/13 14:51 (external edit)