Preferences

With the Preferences functions, you can retrieve information about the whole preference system. The user can set and retrieve the value of any preferences in the software.

The actual name and current value of a preference are in stored in the user configuration file.

The file prefs.xml contains a description of all preferences recognized by the application. The keyword to access each predefined preference is also found in that file.

Scripts can change or retrieve any existing preference, and may create new preferences.

The following is a list of the Preferences functions:

getBool
getColor
getDouble
getEnumValue
getInt
getString
setBool
setColor
setDouble
setEnumValue
setInt
setString

Example

This script that will toggle the property to automatically save layout on exit.

 

function toggleAutoSaveLayout()

{

var b;

b = Application.preferences.getBool( "AUTO_SAVE_LAYOUT", false );

print( "preference to automatically save the layout was " + b );

Application.preferences.setBool( "AUTO_SAVE_LAYOUT", !b );

b = Application.preferences.getBool( "AUTO_SAVE_LAYOUT", false );

print( "preference for auto save layout is now " + b );

 

}

Related Topics 

Scripting Reference