[Feature Request] Window Management of Menubar-based Applications

I have a feature request for providing users with the option to extend window management to apps that are not loaded as the active application in the status bar, but which still have the active window focus.

Namely, these are background apps like Airmail, Fantastical, Chronicle, etc., that the user has elected to “live” in the menu bar, but occasionally opens a full windowed instance of which is hidden from the Dock and Statusbar. Therefore, KM window management commands that act on “normal” application instances are not applied to these applications, as they are not loaded as the “Front Application”. By default, if I have Chrome open and then open an Airmail window, Window management will apply to Chrome, and not the active Airmail window which can be manipulated with other window management applications and hotkey commands.

Currently, this is possible with ad hoc scripting for each application (using the “is at the front”), however, it would perhaps be more elegant to allow an additional option in the target selection field of the window management action. “Any Application” could be placed in addition to “Front Application” in the target selection for the window management actions before being given the discrete system Application list. This would apply the window management to the front window, regardless of it being loaded as the Front Application or not.

This would allow the user to specify the behavior. In some instances, the user may have macros for which they have “menu bar” apps they don’t want to have Keyboard Maestro act on, and other macros they do want KM to act on.

Here’s a primitive example of what I’m talking about:

Front Application would still be the default, but selecting “Any Application” would apply the Window Management action being defined to whatever the active window is. This should be possible, as these applications are actionable through traditional system hotkeys, like Cmd-W and Cmd-Q, and are actionable in Spectacle and HyperDock.

I may try to better support non-foreground applications that have a real window as the front focussed window. But I am not sure how possible or complicated it is.

The Spectacle source code may be a good place to look. Spectacle operates on the front window by default, in the manner that I’ve suggested. Distributed under the MIT license. Quite a few files, but I’d imagine that this might be a good resource.