Unable to execute a macro with name from the variable

OK - in that case there must be something wrong with how you've named your macros.

Can you upload a copy so I can take a look?

Scrub that - I think I've found the problem.

In your z Orders for HTML macro group you have this:

2023-06-30_14-42-33

When I have that my test fails, but when I switch it back to this:

2023-06-30_14-44-20

It works again. Try getting rid of that "Available in these applications" bit and see what happens.

Sure. Here is the last iteration of the main macro and the submacros. The last macros are in the group called "z List of Labs NexGen" which is enabled.

.CBC.kmmacros (1.5 KB)
.CMP.kmmacros (1.5 KB)
#Orders HTML Prompt.kmmacros (41.2 KB)
localA1.kmmacros (1.8 KB)
localA2.kmmacros (1.8 KB)

Screenshot 2023-06-30 at 8.46.50 AM

Re: your last finding - it was available in Citrix Viewer before, and I was in the process of deleting it to allow in all apps, but snapped a picture too early. It is now available for all apps.

P.S. during troubleshooting I also just created two localA1 and localA2 macros (now deleted) with only component in use - display large text "It worked!" to make sure a chain of execute macros is not the issue - still didn't work.

Could it be that the local variable does not work outside KM?
Although VarName is not local...

OK - so I downloaded your macros and did some testing and made some changes.

  • In the z Orders Group I removed the pallette option and renamed the macros from localx to Macrox.
  • for the macros in the z List Group I disabled the empty Execute a Macro actions.
  • In the #Orders HTML Prompt macro, I changed the setting of VarName to use MacroA instead of localA

The macro seems to run fine now.

Here they all are:

#Orders HTML Prompt.kmmacros (41.2 KB)
z List of Labs NexGen and Other Macros.kmmacros (5.7 KB)

I'm signing off now so I won't be able to assist further for a few days. Hopefully it'll work for you now as it works for me.

Cheers and good luck.

2 Likes

@tiffle - really appreciate your help.

I believe the issue was in the first bullet point that you have found:

"In the z Orders Group I removed the pallette option"

Now it works perfectly with localAx :slight_smile:

Yes, that’s what I thought but anyway I’m glad it’s working!

Have a great weekend.

I find it interesting that a macro can be triggered within the KBM when it is placed inside the palette, however it cannot be triggered (appears not seen) by the applescript/outside apps unless the palette is changed to a folder instead.

In order to execute the macro, the macro must be active.

In order for a macro to be active, the macro must be enabled, and the macro group must be enabled and the macro group must be active.

If you configure the macro group to Shows a palette for one action when:

then the macro group is inactive until such time as you show the palette, and only active while that macro group palette is showing.

If you want the macros to be active all the time, use the option Always activated and shows a palette for one action when: option.

You are seeing the macro group as disabled because you imported the macro group and Keyboard Maestro automatically disables imported macros (either the parent macro group or the macro). This is a safety feature to ensure you have an opportunity to view the macro before it executes. You can override it by holding the option key down while importing the macro, but only do this if you know the macro is safe. You could, for example do this:

  • Import the macro.
  • Verify the macro looks safe.
  • Undo.
  • Import the macro with option key held down.
1 Like

@peternlewis, appreciate detailed explanation.

1 Like