I have a OneNote Search macro where I first type text into an input. Once that's submitted, I switch to OneNote where I do the search.
The problem is, if the macro is run multiple times (so multiple KM User Input dialogs are showing) then the process breaks. Submitting the input activates the next input dialog (which was hidden by the second input dialog) and OneNote is never activated.
Primarily I think this is a bug, because Application Switch should work in such a situation - the fact that KM has two user input dialogs up should not matter.
For now, is there some way I can work around this? E.g.:
Check + prevent two of these boxes from coming up
Somehow force KM to switch applications when it apparently doesn't want to
Close ALL identical prompt dialogs when one is closed/submitted
I believe part of the issue here is that the KM input dialog is not considered an input of KM (if I click that dialog now for example, my menu bar is still "Firefox" not KM). The dialog is also not part of the current application (can't cmd+` switch to it). So it's in a no-man's land I'm not familiar with.
I tried "bring window to front of front application" but this also doesn't work for some reason though logically it seems it should... somehow the KM dialog is pinned on top and nothing can wrench focus away.
Thanks for the details and I've read over the materials you recommended. I'm sharing a minimal repro here.
KM version: 9.2
(This is a OneNote example but works the same with other apps, e.g. Messages.)
Press hotkey twice, opening two prompts
Hit Enter to submit prompt
Result: Top prompt closes (bottom prompt still open) and OneNote activates
Press hotkey twice again, opening two more prompts (3 are now open)
Result: OneNote is not activated; instead a KM prompt is activated.
This is one way to repro and repros 100% consistently for me. Any insight on that issue?
Regarding the Semaphore idea, I like it except that if I happen to have had this prompt open already I'd like to macro to still show a prompt - ideally focusing the existing prompt. I'm not sure how to do that though (focus an existing prompt). It would solve the issue of popping up too many boxes but would be a bit annoying if the box doesn't activate, though this would be a corner case for sure.