Detect an app is active when it hovers?

I’m planning to have an automation where when I enter ## in the Quick Entry popup of Things, it simulates a ⌘ + ⇧ + M which will enable the Project/Area selector allowing me to just type the name to put the task in. Same with “@@” and it simulates ⌘ + S to enter the time.

Although BetterTouchTool and other such automation apps allow app-specific triggers, the problem is they only work when an app is active. When activating Quick Entry of Things, the current app is still something else, Things Quick Entry is just a hover.

See this, although, Brave is the active app (top left corner) but Things is capturing keyboard presses.

Not sure if it will work, but you might try setting the “active app” to Things — that’s what I think runs the universal capture.