Using the scripts widget

Can you provide an example of how to use the script widget.

also like to know if it can do the follow. If toggle button 1 is on then toggle button 2 is off, so that both button are not on the same time

You don’t need a script to do that, you can set the buttons’ value property as follow:

// button_2's value property
return @{button_1} == 1 ? 0 : 1
// button_1's value property
return @{button_2} == 1 ? 0 : 1

There are a few discussions about scripts were you can find some examples:

In v0.46.2, this would work too:

  1. create a script
  2. set its value property to “@{button_1} @{button2}” to link it to the buttons’ values
  3. set its script property as follows:

var widget =  id == "toggle_1" ? "toggle_2" : "toggle_1",
      newValue = get(id) == 1 ? 0 : 1

set(widget, newValue)


Hi Jean,

is this also possible with a matrix widget and some toggle buttons?
Or is ther a different way?

Cheers and thx stephan