El Capitan 10.11.6 and Keyboard Maestro Engine got an error: do script found no macros with a matching name

Just updated to El Capitan 10.11.6

Started working on a new AppleScript to trigger a new KM Macro. I copied the code from KM and ran it. For some reason it’s not working now. I also ran a known working script and now that’s not working either. Did something break in 10.11.6 or have I just overlooked something?

The script is enabled and it’s active.

When I run the AppleScript I am getting the all too familiar error:
“Keyboard Maestro Engine got an error: do script found no macros with a matching name.”

In order to help you, we need to see the actual scripts and macros that don’t work.
Please post these as well as specifically what is not working.
How to Post/Upload Your Macro to the Forum

Well I haven’t actually even gotten into the Keyboard Maestro action but the AppleScript looks like this:

tell application "Safari"
	if not running then run
	activate
end tell
-- ignoring application responses
tell application "Keyboard Maestro Engine"
	do script "2F60BFBF-2134-4C2F-9CD3-391A40xxxx"
	-- or: do script "Partners Statement Download"
	-- or: do script "2F60BFBF-2134-4C2F-9CD3-391A40724860" with parameter "Whatever"
end tell
-- end ignoring

The normal cause for that is trying to execute a macro that either:

  • Does not exist.
  • Is disabled.
  • Is in a Macro Group that is disabled.
  • Is in a Macro Group that is currently inactive.

[quote="peternlewis, post:4, topic:4448, full:true"]
The normal cause for that is trying to execute a macro that either:

Does not exist.[/quote]
It does.

It's enabled.

It's in the same group as the previous working Safari macros.

They haven't been de-activated.
They are all active.
Are there conditions that exist during editing that might stop them?

What does your macro group settings look like?

Is this what you are asking about?

Yes. So is Safari at the front at the time your script runs?

I see you activate Safari in the script, but its possible Safari has not actually activated, or that Keyboard Maestro Engine has not responded to the activation and activated the macro group, at the point that the script asks for the macro to be executed.

Try running your script after manually activating Safari, does that work?

Why, yes! It does.

Right, so the macro group is not quite enabled yet when you try to trigger the macro.

Move the macro so it is in globally available macro group, or depending on how you are running the script, possibly you can use Keyboard Maestro’s Activate a Specific Application action to activate Safari first.

Ok. So the first tell block (see AppleScript above) doesn't activate Safari?

It probably does activate Safari - but the actual activation probably has not completed, and even if it has, Keyboard Maestro Engine needs a chance to recognise that it has and update the activations of the macros. If you put a delay in the script between the two, that might be enough.

1 Like

Well alrighty then. :slight_smile: