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


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.


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

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


10.0NewNew in this version.