Text Source Custom Scripts

The Custom Script Editor of the Text Source properties window uses annotations in comments for declaring UI components as well the values that needs to be saved in the configuration of the text source itself.

Example:
/** * @name Mode
* @label Mode
* @type select
* @options Clock||Clock24||Count||Date||Duration||Timer
* @description Clock = Current Time AM/PM format||Clock24 = Current Time 24hour format||Count = Counts towards or away from a certain Time and Date.||Duration = Counts up from time of load, remember to check "Keep Source in Memory" to avoid reload in-between scenes||Timer = Counts down a certain number of minutes and seconds. This is reset on scene change unless "Keep Source in Memory" is checked. If more than 2 hours use Count
*/
var Mode = "Clock";

Each “key-value” pair within the annotation should always be in one line, starting with an asterisk (*), followed by a space, the “key” preceded by an “@” sign, then a space, then the “value” and ending with a carriage return.

Common Annotation Keys
Name
Variable name, used for saving values in configuration.
Label
The label to be used for the UI component.
Type
Determines the type of UI component to be used.
Description
If present, the tooltip text to be displayed, tooltip title will be same as label.
Linebreaks are added by using a double-pipe (||). This annotation line is optional.
Value Types Used
text
▸ A simple text field which accepts values as string.
int
▸ A text field which only accepts integers.
▸ Reverts to former value if invalid input is supplied.
▸ Accepts an extra optional annotation line, @positiveOnly, value of true or false, which when true, invalidates when entering negative integers.
float
▸ A text field which accepts floating point values.
▸ Reverts to former value if invalid input is supplied.
▸ Accepts an extra optional annotation line, @positiveOnly, value of true or false, which when true, invalidates when entering negative integers.
select
▸ Dropdown component.
▸ Must have the required annotation line, @options, a double-pipe (||)-delimited string containing the choices for the dropdown. Component is not shown if @options is not present.
▸ Has a special option string “currentSceneSources”, which when used as the first/only option in the optionstring, lists all the sources for the scene the source is in.
spinner
▸ Number spinner component.
▸ Accepts an optional annotation line, @max, which pertains to the upper limit of the spinner. This defaults to 100 if not present.
▸ Accepts an optional annotation line, @min, which pertains to the lower limit of the spinner. This defaults to 0 if not present.
▸ Component is not shown if min value is set higher than max value.
▸ Accepts an optional annotation line, @step, which pertains to the increments/decrements when clicking on of the spinner arrows. This defaults to 1 if not present.
▸ Reverts to former value if invalid input is supplied, max value if supplied value is higher than max, or min value if supplied value is lower than min.
date
▸ Date input component which also displays a per month calendar.
▸ Accepts and provides value in the format MM/DD/YYYY.
▸ Reverts to former value if invalid input is supplied.
time
▸ Time spinner component.
▸ Accepts and provides value in the format HH:MM, in 24-hour format
▸ Reverts to former value if invalid input is supplied.
file
▸ File dialog component.
▸ Accepts an optional annotation line, @filters, in the format of “<Filetype description>|*.<ext>|<Another filetype description>|*.<another ext>...||” , double-quotes included, such as "Text Files (*.txt)|*.txt|All Files (*.*)|*.*||".
▸ Accepts an optional annotation line, @extension, which is default file extension when inputting via typing.
▸ Accepts an optional annotation line, @defaultFilename, which is default filename upon opening of the file dialog.
▸ Accepts an optional annotation line, @flags, which provides customization for the file dialog. See CFileDialog link for list of flags such as allowing multi-select, enabling resize, etc.
boolean
▸ Checkbox component.
▸ Accepts and provides boolean values.
radio
▸ Radio component.
▸ Must have the required annotation line, @options, a double-pipe (||)-delimited string containing the different radio button choices. Component is not shown if @options is not present.
▸ Value defaults to the first choice if first value supplied is not valid (not in choices).
range
▸ Slider component, with increment and decrement buttons.
▸ Accepts an optional annotation line, @max, which pertains to the upper limit of the spinner. This defaults to 100 if not present.
▸ Accepts an optional annotation line, @min, which pertains to the lower limit of the spinner. This defaults to 0 if not present.
▸ Component is not shown if min value is set higher than max value.
▸ Accepts an optional annotation line, @step, which pertains to the increments/decrements when clicking on of the spinner arrows. This defaults to 1 if not present. reverts to former value if invalid input is supplied.
head
▸ Header component, which indicates section within the UI.

Forgot your password?

Did you forget your password? No worries! Enter your email address below we'll help you gain your access back.


Notice

Sorry, your session has expired. Please log in again.