User Tools

Site Tools


Sidebar

settings:savesetting

saveSetting()

Function to save a setting that can be reused the next time this script (or a different script is run).

Note:

  • All scripts use the same settings file. Because of this, settings can be shared by multiple scripts. Make sure to assign unique setting names when settings are to be unique for a script.
  • I have tested this function with all levels of User Account Control on windows 7 and I found no problems. If you do find a problem with writing files, please contact me.

Usage

To save a setting for the opened project:

saveSetting('mysetting', 'value', 'project');

To save a system wide setting:

saveSetting('mysetting', 'value', 'global');

To save a setting with multiple values:

var value = new Array('value 1', 'value 2', 'value 3');
saveSetting('mysetting', value, 'global');

Parameters

Parameter Data type Required Description
setting string true The name of the setting to save
value array/string true The value to save
scope string true The scope of the settings file. Use project for a saving in the current project or use global for saving for your user account on the current machine

Return Values

This function has no return values.

settings/savesetting.txt · Last modified: 2017/06/03 13:41 (external edit)