I’m using Keyboard Maestro and Alfred together, and with the latest Alfred version, I met a problem.
The new feature of Alfred is when it’s shown, it won’t make the current application inactive, so there is no way now to tell if the current active app is Alfred or not. I’m doing key mappings and now the key mappings apply to Alfred, too.
The solution described by Karabiner’s author is probably not something I can do for Keyboard Maestro. I will look to see if there is anything else that can be done.
No. Currently Keyboard Maestro has no idea that Alfred has taken over the focus and that the application is not focused. Essentially Alfred is behaving as if it is a window within the current application, and Keyboard Maestro treats it the same way (though I expect from Keyboard Maestro’s point of view the window is also invisible to Keyboard Maestro).
It used to have application-focus when its window was in focus, but in their infinite wisdom the devs changed that several years ago – and destroyed much functionality (from my point of view).
The old way allowed me to have LaunchBar-specific macros, and it did NOT interfere with my app-specific macros when LaunchBar was in focus.
I’m still chapped about that.
AppleScript and System Events can detect whether Alfred’s window is open or not:
tell application "System Events"
tell application process "Alfred 2"
if subrole of windows = {"AXSystemDialog"} then
beep
end if
end tell
end tell