RW - Backup KBM Macros Macro (v11.0.3)
RW - Backup KBM Macros.kmmacros (8.7 KB)
I have found that if I run from the editor the export as folder display is different than if run by a trigger.
If run by the editor the Save as entry is highlighted
If I run by trigger the Save as is not highlighted
Roger
The problem is that when you run it via the trigger, the Keyboard Maestro Editor is not frontmost, so that field can't have focus. All you need to do to fix it is to activate Keyboard Maestro before you paste:
You might also want/need to add a "Pause until Keyboard Maestro is frontmost" action after the activate, but generally it works without one.
The macro should then work as expected.
-rob.
Thanks rob
That did the trick. I guess is expected it to run the same in both places?
It actually does work the same in both places, but the OS behaves differently in each situation: Only foreground windows can have focus on text fields. The macro is doing the exact same thing regardless of how you trigger it, but the OS behaves differently depending on what app is frontmost when you trigger it.
With the editor frontmost, the name field is selected and has focus:
But when run from some other app, the OS can't give focus to the name field, but it's still selected—just inactive:
The macro itself, though, is doing the exact same thing in both situations: You asked it to activate a menu, and it did…it's just that when used via the trigger, you've activated it in the background, and you can't interact with the dialog unless it's frontmost.
It's an important consideration when building macros: If you want to interact with an app, it's best to make it frontmost, then do your interaction. Some things might work in the background, but generally, they'll either work differently or not at all. So before invoking any menu items, activate the app in which you want to activate the menu.
-rob.