getpreferenceclass(
getpreferenceclass(
PREFERENCE
,
DOMAIN
)

The getpreferenceclass( function retrieves the class name of a preference value.

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

This function is similar to the getpreferencevalue( function, but instead of returning the value of the preference, it returns the name of the Objective-C class associated with the value. If you are familiar with Objective-C, you can use this function to help understand what is stored in preferences stored by Panorama and by the operating system.

This example shows that the toolbar configuration is stored using an NSDictionary object, which is a complex compound object that cannot be read by the getpreferencevalue( function. (Super Technical Note: `__NSCFDictionary` is actually a private member of the NSDictionary class cluster.)

    getpreferenceclass("NSToolbar Configuration Form Toolbar") ☞ __NSCFDictionary

#### 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("LastUsedPrinters","org.cups.PrintingPrefs") ☞ __NSCFArray

Unfortunately, this preferences is stored using an NSArray objtect, which is a complex compound object that cannot be read by the getpreferencevalue( function. So this information (the last used printers) is not accessible from Panorama. (Super Technical Note: `__NSCFArray` is actually a private member of the NSArray class cluster.)

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.

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