I just want a simple mouse click to define a software state "track_focus" to be "track" od "bus" depending what do you select with the mouse.
That is what happens in mentioned "_Strip" control, using "focused" strip monitoring. "Strip" Action is searching some strip, with predefined type. "Recall focused" Action gets current focused strip and its type from Cakewalk.
Terminology is a bit strange there, but correct. There can be just once "focused" strip, either Track or Bus. But both types have "current" strip all the time, independent which pane is currently in focus. "Current" strip is the last "focused" in the specified type. So if you focus "Track 5" and then "Bus 2": "Track 5" is current Track, "Bus 2" is current Bus, "Bus 2" is focused strip.
I could put that functionality into "Strip", adding "Focused" option into the strip type. But then it needs one more extra parameter, for the focused type. And that Action is already complicated. So I have decided to do this in "Save/Recall", where the strip type can be extracted from "focused" or previously saved strip.
The monitor is required to persistently save focused type ("Set engine state" in the Logic tab has special meaning, long story... so it is grayed in the "Save/recall" Action in the Logic tab). Since we effectively monitor changes in focused strip, the monitor also update WAI (with X-Touch Mini preset logic, changing focused strip always change WAI there, unlike in many other presets).
The evil is really in details