setglobaldictionaryvalues
setglobaldictionaryvalues
DICTIONARY
,
KEY
,
VALUE

The setglobaldictionaryvalues statement sets one or more key/value pairs in a global dictionary.

Parameters

This statement has three parameters:

dictionary – is the name of the dictionary to be created/modified.

key – is the name of the key the value (next parameter). You may repeat multiple key/value parameters.

value – is the value to be associated with the key (previous parameter). This may be text, a number, or binary data.

Description

This statement sets one or more key/value pairs in a global dictionary. For example, this code sets up a private dictionary with three values: Color, Scale and Size.

    setglobaldictionaryvalues "MyValues","Color","Violet","Scale",80,"Size","Large"

Later, you can use the globaldictionaryvalue( function to retrieve any of these values, for example the scale.

    globaldictionaryvalue("MyValues","Scale") ☞ 80

If you need to change the scale value, you can do so at any time with another setglobaldictionaryvalues statement, like this:

    setglobaldictionaryvalues "MyValues","Scale",45

This will change the scale value while leaving the color and size (and any other values) alone.

See Global Dictionaries for an extended discussion of how this statement can be used.

See Also

- Confirmation Alerts -- Configuring alerts to confirm sensitive operations (deletions, etc.).
- getapplicationinfo( -- retrieves the value of an item in the application's plist, or a list of all plist items.
- getpreferenceclass( -- retrieves the class name of a preference value.
- getpreferencevalue( -- retrieves the value of a preference.
- info("preferencedomains") -- returns a carriage return delimited list of available preferences domains.
- preferences( -- retreives a list of preferences that have been stored.
- removepreferencevalues -- deletes one or more preference values.
- setpreferencevalues -- creates and/or modifies a preference value.
- writepreference -- modifies a preference value.

History

Version | Status | Notes
10.2 | New | New in this version.