Options
Scripts are supposed to be pretty simple, but sometimes you want the user to configure them, for example to turn on/off specific abilities of the script instead of just enabling/disabling it entirely.
You can do this using the options API, which allows you to add arbitrary entries into the script menu.
Each option has common properties, like a type
, id
and an optional label
, which defaults to the ID.
Buttons
The most ubiquitous of them all, the button. It does exactly what one would expect it to do - an action is triggered when you press it.
Checkboxes
An obvious solution for boolean configuration options, a checkbox!
Checkbox checked state is not persisted by slicer and will be RESET on refresh.
Radio buttons
For whenever you need to represent an enum-like value, there’s always a radio button.
Radio button selection is not persisted by slicer and will be RESET on refresh.
Groups
Last but not least, there’s the group option for cases where you need to group related options together into one slick menu.