-
Notifications
You must be signed in to change notification settings - Fork 15
Setting custom variables
This is an experimental idea, that may be removed without notice
Sometimes, an action can produce a bit of data that the user may want to do something with. In these cases, it doesn't make sense to write it to a variable from your module, as another action on the same button could overwrite it too soon.
Instead, you can output to a custom-variable. To do so, you can add an input field of type 'custom-variable'. The options to this are automatically populated for you.
Then inside your action callback, you can do a call like this.setCustomVariableValue(action.options.result, 'Your value')
to set the value.
Note: If the variable id is not valid you will not be informed.
Some additional rules around this:
- Remember that these variables are owned by the user. You should only change them when asked.
- This must be opt-in by the user. The input field will default to 'None', and you must respect that
- You must not set the value of any custom variables at times other than the result of an action
- You must not attempt to discover the custom variables in any way other than the value of this input field.
Getting Started
- Home
- Module development 101
- Git crashcourse
- Upgrading a module built for Companion 2.x
- Companion module library versioning
- Releasing your module
Development
- File Structure
- manifest.json
- Logging
- Module packaging
- Actions
- Feedbacks
- Presets
- Input Field Types
- Module configuration
- Upgrade scripts
- Variables
Code quality
Advanced functionality