Class ScriptPrefs
Version added: before 9.5
The ScriptPrefs class allows user scripts to store and retrieve settings. These stored settings are re-loaded each time Moho is run. Stored values are stored under a key name (a text string). Typically, so that different scripts don't interfere with one another, a script should use its own name as part of the key. For example, if the "MyFirstScript" script wanted to save the "pointCount" setting, it would save it using the key "MyFirstScript.pointCount".
Methods of ScriptPrefs:
Name | Returns | Description | Ver |
GetBool GetBool(key, defaultValue) | bool | Retrieve a boolean value that was previously stored | < 9.5 |
GetFloat GetFloat(key, defaultValue) | real | < 9.5 | |
GetInt GetInt(key, defaultValue) | int32 | < 9.5 | |
GetString GetString(key, defaultValue) | char | < 9.5 | |
SetBool SetBool(key, value) | void | Store a boolean value | < 9.5 |
SetFloat SetFloat(key, value) | void | < 9.5 | |
SetInt SetInt(key, value) | void | < 9.5 | |
SetString SetString(key, value) | void | < 9.5 |