getpreferencevalue(
getpreferencevalue(
PREFERENCE
,
DOMAIN
)

The getpreferencevalue( function retrieves the value of a preference.

Parameters

This function has two parameters:

preference – is the name of the preference to be retrieved.

domain – is the name of the domain that contains the preference. This parameter is optional, if omitted then only Panorama and system preferences can be retrieved.

Description

Panorama uses OS X to manage the storage of preferences for each user. Using preferences, you can easily store user preferences persistently so that they are retained when Panorama is quit and relaunched. This system is also used by Panorama itself to store preferences, and also by OS X. You can use the getpreferences( function to access any stored preference value.

Each preference has a name and a value. (Apple calls the name a “key”). In this example the name is JKAreaCode and the value is 562. (To change the value, use the setpreferencevalues statement.)

    getpreferencevalue("JKAreaCode") ☞ 562

The getpreferencevalue( function can retrieve any value you have stored with the setpreferencevalues statement, and it can retrieve text, numbers and Boolean values stored by Panorama or the operating system. More complex data stored by Panorama or the operating system cannot be retrieved (a future version of Panorama may have additional capabilities for retrieving more complex data).

#### Specifying an Additional Domain

Normally only preferences stored by Panorama or the operating system can be retrieved. By adding a second parameter, additional domains can be included. This example retrieves the name of the person that most recently created a PDF file on this computer.

    getpreferencevalue("PDFAuthor","org.cups.PrintingPrefs") ☞ John Warnock

Use the info(“preferencedomains”) function to get a list of all of the available domains on your computer.

Error Messages

preference “name” does not exist – There is no preference with the name you requested.

cannot decode value of preference – The requested preference contains a complex data type that is not compatible with Panorama.

See Also

- Automatic Startup Database -- automatically open one or more databases when Panorama is launched.
- 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.
- 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.
- Scripting Language Configuration -- configuring the scripting languages available to Panorama (Perl, PHP, Python and Ruby).
- setpreferencevalues -- creates and/or modifies a preference value.
- writepreference -- modifies a preference value.

History

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