Skip to content

Button widget and scripting

elgarf edited this page Jan 29, 2018 · 4 revisions

Button widget is most complex widget in UTC. Using it you can just execute some API functions or completely automate your work. With ExecLink capabilities it also can interact with another widgets.

Execution flow

By default commands in script executed sequentially, but with Condition and GoTo commands you can make branches and loops. Just don't forget to add Timer delay because script don't wait when command will be executed.

UTC native commands

Except vMix API comands, there is some UTC native commands, which works only in UTC.

Timer

Timer command add delay in msec to execution flow.

ExecLink

ExecLink command execute named shortcut of any widget into controller. So you can make something like procedures, executing scripts from another buttons.

GoTo

GoTo command set execution pointer to Command Index value, so you can skip or repeat some commands. Please, avoid infinite loops.

SetVariable

SetVariable command sets internal variable value. It's seen only in button script, you can't access it externally.

Condition & ConditionEnd

Condition command has two input parameters for fast access to input keys. So if you need compare two values from different titles, you don't need to copy-paste keys from your browser. There is two substitutions: {0} for input 1 key and {1} for input 2 key. You can use this substitutions in state access function. Condition command opens condition branch, all commands between Condition and ConditionEnd executed if condition is true. Otherwise they will be skipped. In combination with GoTo command you can make If-Else statement.

  1. Condition
  2. IfCommand 1
  3. IfCommand 2
  4. ...
  5. GoTo 9
  6. ConditionEnd
  7. ElseCommand 1
  8. ElseCommand 2
  9. Command 1
  10. Command 2

So, if condition is true commands 2-5 executed, and 7-8 skipped; if condition is false, commands 7-8 executed and 2-5 are skipped.

HasVariable

HasVariable command is the same as condition, but just check that some variable is exists. You must close it with ConditionEnd command.

UpdateState

UpdateSTate command updates global UTC state, which affect on all widgets.

UpdateInternalButtonState

UpdateInternalButtonState command updates state, which used only into state dependent buttons.

vMix API commands

All other commands are from vMix API, you can add them manually to Functions.xml file, or use existing ones.