Using the "plugin is running" with a duration modifier "for exactly 0 seconds" should do the trick.
Okay. What I posted seems to work too, probably because of the "edge-detect button" as I think of it. I was just wondering what the "best practice" was, if there is one.
Low priority, but how hard would it be to make an obvious "run once at startup" function? My first thought was a separate section that had all of the actions available but no conditions, and that's when it runs, but far more flexible might just be a dedicated condition that is true between startup and the first time its actions are executed, and never again. Then it could be combined with other conditions to delay the "init code" until it can actually work (init AND something else), or to repeat the "init code" without copying it (init OR something else).
It might even replace the "plugin running" condition, since it seems silly to me to have a condition that always returns true. In a loop, yes, I can see a boolean constant to run that loop forever, and I've also used "if(false)" to (temporarily!) disable a section of code (it's also easily searchable). But neither of those are relevant here, as there are no loops and there's already a dedicated disable button.
The second condition is still checked regardless.
Is the scene switcher using a considerable amount of CPU time in your setup? (Can be checked by comparing OBS CPU usage with the plugin stopped / started).
Good to know. So it's not doing the "short-circuit" logic that most other languages do, where only the first condition is always checked, and each one after that is only checked if it still makes a difference.
This entire system barely registers on my CPU meter, but my experience with 8-bit microcontrollers (lots of projects with a single core @ 20MHz, using 4 clocks per instruction, and 300-some bytes of RAM for the entire system) leaves me a bit paranoid. So it's become automatic for me to estimate the cost of each comparison (boolean is best, numbers are okay, and strings take forever), and then guard an expensive one to only run when it's actually needed. This often leads to logically redundant (but cheap) conditions being added to the front, and sometimes odd ordering, just to take advantage of the "short-circuit" logic.
But if the "short-circuit" logic just doesn't exist here, then the "guard conditions" only hurt. Their cost is tiny, but still there (I'll probably never stop thinking about optimization), and they clutter things up to read later. I'll take them out.
I guess the option to "highlight recently matched conditions" kinda forbids the "short-circuit" logic. And that's a very nice feature to have!