Why are Macros for QuarkXPress failing?

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).

Any ideas what I -- or KM -- are doing wrong?

Take a look at the error message. It is telling you exactly why it failed:

Select Menu Item failed to find target menu item Style>Character Style Sheet>track number.

This means at the time when the macro was run, it could not find the menu item Style>Character Style Sheet>track number

I don't have QuarkXPress, so I can make any further suggestions, other than double-checking this menu item before you trigger the macro.

We might be able to be of more help if you could upload your macro .

Please read:
Tip: How Do I Get The Best Answer in the Shortest Time?

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.

I do have another one, which I am again pasting below here. For the record, I am new to KM and these are the only two macros I've made thus far!

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:

I'm not sure what is meant by "do the workflow that causes the error."

It means to perform whatever actions are necessary on your Mac to cause the error you are reporting.