On Click Events with Item Banks of a Switcher Widget

Is it possible for ‘onclick’ events to occur on each bank within a switcher widget?

In short, I am trying to make each bank within a switcher widget also act as push buttons would when selected/on click, in order to send out unique text commands (i.e. “set Input 1 Level -6.0”) to an external OSC listener.

I can achieve seamless functionality between O-S-C and external devices when I place my text command in the “On” text field of a push button widget, but I am struggling to figure out how to achieve this by selecting the banks of a switcher on click.

You could use a script widget to send these commands when the switcher’s value changes:

  • set the script’s value to @{switcher_id}
  • set the script property as follows:
JS{{

var selected = value._selected;
if (selected == "A") send("127.0.0.1:5555", "/some/address", "some_value")
// etc

}}

Thanks Jean-Emmanuel, you are the best!