Is there a way to change the value of a widget (toggle) without the widget sending a midi message?

Hi , I’m on v0.49.12 . I have a “Open All” and “Close All” push button that turns on and off multiple toggle widgets accordingly . I do this by using the set() function for each toggle that I want to modify inside a Script widget that targets the Open/Close All buttons ( one script per button).

However ,when the values of the toggles are assigned this way , each toggle sends its corresponding MIDI message. What I want to do is that the toggles only send their messages if they have been activated or deactivated by the user clicking on them but not by the use of the “Open/Close All” button . Is there any way of doing this?

I was thinking in activating the bypass function for each button , setting the values via the script and then deactivating bypass but I don´t know how to do it or if its even possible.

Here is the code I use to turn the toggles on

JS{{
if(value==127)
{
set("woodwinds",127)
set("brass",127)
set("keys",127)
}
}}

I was thinking in activating the bypass function for each button , setting the values via the script and then deactivating bypass but I don´t know how to do it or if its even possible.

You could use an input widget to store this bypass state, use it in the toggles’ property (@{input_id}), and set it before and after the value changes:

set('input_id', true)
// set('keys', 127) etc
set('input_id', false)