I am using Keyboard Maestro 9 in Mojave. I have written two macros for QuarkXPress, which function properly when used in KM, but which are prompting an error message to appear whenever I switch to Quark. I have disabled the macro group, yet the error continues to appear. Given these circumstances the message doesn't appear to be correct, but I'll quote it here anyway:
Macro Cancelled
Select Menu Item failed to find target menu item Style>Character Style Sheet>track number. Macro "track number" cancelled (while executing Select "track number" in the Menu "Style" in QuarkXPress 2016).
The macro is set to function only in QXP. Yet the error message appears immediately upon bringing QXP to the foreground (via Application Switcher), before I've even made a keystroke in it. It even appears after I've disabled the group that the macro is in.
I haven't been able to find a way to attach the macro itself to this message, and therefore am pasting a screenshot of it here:
Cross platform applications, including Finale and many Adobe applications, do not necessarily update or even build their menu bar until the menu is selected with the mouse. When asked for the menus via the accessibility subsystem, the menus are either not there, or not currently correctly built for the context (eg, menus may be disabled or invisible when they should not be).
Options to force the application into updating its menus include:
Switch out and back to the application, and then use the Select Menu Item action.
Use the Show Menu variant (leave the item field blank) of the Select Menu Item action to show the menu item first, and then the Select Menu Item.
Simulate a click in the menu bar, and then use the Select Menu Item action.
Desperate measures, simulate a click in the menu bar, and then use arrows and typeahead (Insert Text by Typing) to select the menu item.
I have found that at least for menu-based actions there is an option to "Notify On Failure." I have turned that off for all of the menu-based actions in the problem macro, and yet am still getting the Macro Cancelled error.
Then most likely you have another macro that is triggered when QXP launches or activates and attempts the same menu action. Do a global KM search (⌘⌥F) on "track number" (or other keywords in your macro) and see if it finds another macro.
Thanks for posting, but I still strongly suspect another macro is causing the issue.
Please do the workflow that causes the error, and then immediately open the KM Editor "Used" menu ( in the toolbar) and see what was the last macro that was run: