And here the WebControl-Version:
Very performance saving. It starts the script once, after activating or deactivating audio, with the help of control surface buttons.
Demo Download:
https://drive.google.com/file/d/1No38cMp1LUsxTKcMdcNnm3L7cjsRK5g_/view?usp=sharing
Hint:
If you want to use the trigger with audio which is faded in/out, please start the script with a sleep()-command. It should wait for a bit longer than the audio needs to fade in/out. While a transition, the layer status might not be exactly on or off. So, the script should wait before triggering it.
What do you think? How many buttons may be saved by this technique in a real setup? How many layerSets and click-handling is avoided during a show, especially when you have 8 dynamic inputs? Yes, the script is complex, but the result is so easy that one person can switch it while doing a one-man/-girl show.
See also:
How to avoid a Script from being processed, while another script is running?