Settings

Number Setting

1
var testSetting = script.numberSetting(name, defaultValue, min, max, increment)
Copied!
script.numberSetting(... will return a number setting that allows for the following functions:
Function
Description
getValue()
Returns the current value of the setting as a Number.
getMinValue()
Returns the min value of the setting as a Number.
getMaxValue()
Returns the max value of the setting as a Number.
setValue(newValue)
Sets a new current value of the setting.

Boolean Setting

1
var testSetting = script.booleanSetting(name, value)
Copied!
script.booleanSetting(... will return a boolean setting that allows for the following functions:
Function
Description
isEnabled()
Returns the setting's state as a boolean.
toggle()
Changes the current state of the setting to the opposite. i.e true turns to false and false turns to true.
setState(state)
Sets the current state of the boolean setting to the new state.

Mode Setting

1
var testSetting = script.modeSetting(name, startMode, modes...)
Copied!

Modes Input

1
var modes = ["One", "Two"]
2
var testSetting1 = script.modeSetting("Mode", "One", modes)
3
​
4
// OR
5
​
6
var testSetting2 = script.modeSetting("Mode", "One", "One", "Two")
Copied!
script.modeSetting(... will return a mode setting that allows for the following functions:
Function
Description
getMode()
Returns the current mode as a String

Color Setting

1
var testSetting = script.colorSetting(name, color)
Copied!

How to create a Color object​

1
var color = color({
2
red: 1,
3
green: 1,
4
blue: 1
5
})
6
​
7
var testSetting = script.colorSetting("Color one", color)
8
​
9
// OR
10
​
11
var testSetting = script.colorSetting("Color 2",
12
color({ red: 1, green: 1, blue: 1, alpha: 210}))
Copied!
script.colorSetting(... will return a color setting that allows for the following functions:
Function
Description
getColor()
Returns the java.awt.Colorobject (This allows for other functions such as getRGB(), geRed(), getBlue(), getGreen(), and more)
getHue()
Returns the hue of the current color as a Number.
getSaturation()
Returns the saturation of the current color as a Number.
getBrightness()
Returns the brightness of the current color as a Number.

String Setting

1
var testSetting = script.stringSetting(name, containerString)
Copied!
script.stringSetting(... will return a number setting that allows for the following functions:
Function
Description
getString()
Returns the current String in the text box
setString(newString)
Sets the current typed String to the new string parameter
Last modified 2mo ago