Consider a solution with two windows open. Same layout in both windows but different found sets.
Window 1 is active, now the user makes window 2 active by clicking into the window.
No other action happens.
How can a change of active window be captured and used to trigger a script?