Skip to content

Properties object

app.properties

add description here


None.


app.properties.clearProperty()

add description here

add parameters here

add return value/type here


app.properties.doesPropertyExist(property)

Checks whether a given property exists in preferences.

ParameterTypeDescription
propertyStringA property to check

Boolean.

Check whether labels with indices 10 and 99 exist in preferences:

var property = 'BE.Prefs.LabelNames.10';
var exists = app.properties.doesPropertyExist(property);
alert('Property "' + property + '" exists: ' + exists.toString());
property = 'BE.Prefs.LabelNames.99';
exists = app.properties.doesPropertyExist(property);
alert('Property "' + property + '" exists: ' + exists.toString());

app.properties.getProperty(property)

Returns a property value.

ParameterTypeDescription
propertyStringA property to get a value for

String.

Get label name at a given index:

var labelIndex = 0;
var property = 'BE.Prefs.LabelNames.' + labelIndex;
if (app.properties.doesPropertyExist(property)) {
alert(app.properties.getProperty(property));
} else {
alert('Property "' + property + '" does not exist');
}

app.properties.isPropertyReadOnly(property)

Checks whether a given property can be overwritten by the user. Returns false if such property does not exist.

ParameterTypeDescription
propertyStringA property to check.

Boolean.


app.properties.setProperty(property, value, persistent, createIfNotExist)

Set property value.

ParameterTypeDescription
propertyStringA property to create
valueAnyA value for a property
persistentBooleanWhether if should be persistent between sessions
createIfNotExistBooleanShould create, if such property does not exist

null

Change label name:

var labelIndex = 0;
var property = 'BE.Prefs.LabelNamesX.' + labelIndex;
var newValue = 'Changed via Script';
var persistent = true;
var createIfNotExist = true;
if (app.properties.doesPropertyExist(property)) {
if (app.properties.isPropertyReadOnly(property)) {
alert('Could not rename property "' + property + '" because it is read-only.');
} else {
var oldValue = app.properties.getProperty(property);
app.properties.setProperty(property, newValue, persistent, createIfNotExist);
alert('Value changed from "' + oldValue + '" to "' + newValue + '"');
}
} else {
app.properties.setProperty(property, newValue, persistent, createIfNotExist);
alert('Created new property "' + property + '" with value "' + newValue + '"');
}