External script triggers fail in Yosemite

I upgraded to Yosemite last week. After the upgrade all my external trigger applescripts fail regardless of the method used to run them. This is the error I get when running from within Script Debugger -

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

The macros perform normally from within Keyboard Maestro.

For a macro to be executable, it must be active, that is, the containing macro group must be enabled and currently active, and the macro must be enabled.

Check your configuration of your macro group, that is likely where the issue is.

The scripts in question functioned perfectly prior to updating to 10.10. The only change was the upgrade of the OS.

It appears as though the OS update is denying access to the Keyboard Maestro Engine even though permissions, accessibility etc. appear to be set correctly for access.

No, this error:

indicates that Keyboard Maestro is working fine, and has no particular problems, except that the desired macro either does not exist or is not currently active. Yosemite has lots of pain with regards to conjuring accessibility permissions, but this is not a symptom of accessibility permission problems. AppleScript access does not require accessibility permissions.

Find the macro you are trying to execute, and then:

  • verify that the macro is enabled.
  • verify that the macro the name or UID actually matches the name or UID you are using in your AppleScript.
  • verify that the macro group is enabled.
  • verify that the macro group is currently active (better still, ensure it it active in all applications at all times).

The above list was all accomplished prior to my first post, several times.

I figured all along that it was Yosemite (possibly the changes made to AppleScript) causing the problem but hoped you might have a workaround. For what it’s worth, both my desktop and my laptop suffer the exact same problem for the same reason.

Well, try this simple test:

  • Create a new macro in the Global Macro Group.
  • Add a Notification action.
  • In the trigger section, select Or by AppleScript.
  • Copy the AppleScript text.
  • Launch Script Editor, create a new script, and paste in the text.
  • Run it.

See if that reports an error.

I just tried it on my Mac without any problem.

That worked, I’ll redo a few of my scripts/macros and report the results. Thanks!

Apparently external scripts will work with macros as long as they are part of the Global Macro Group but not another user created group.

I recreated everything I use for reading emails i.e. Macro Group, macros and scripts. Same error occurs with all of the scripts. Moved the macros to the Global Macro Group and all scripts functioned perfectly. It seems like Yosemite may have a problem reading plist files.

It’s messy but it is a solution for now. Thanks for the help.

Your other macro group must be disabled or inactive.

Perhaps post a screenshot of the macro group configuration in question.

I must have missed describing a step.

I have a set of macros that I’ve been using since I installed KM. I called these macros from Dragthing using AppleScript as it provided a stable palette. They have functioned perfectly in all Mac OS systems prior to 10.10. Immediately upon installing the Applescripts ceased to activate the macros although the errors indicate the scripts are correctly sending the events. This happens when the macros are installed in any macro group other than the Global Macro Group.

If I move the macros to the Global Macro Group they work when called from AppleScript.

All macro groups are enabled as are all macros. All Macros function normally when called from within KM regardless of the macro group they are installed in.

I experience the same behavior since upgrading to Yosemite – macros that are part of a macro group that applies to only specific application(s) cannot be executed using AppleScript anymore. Copying/moving them to the global macro group or another group that applies to all applications makes them executable again.

Is there no way you can make the original behavior work again? I have some application specific macros (that have a keyboard shortcut that should only work in these application) that I want to trigger using AppleScripts from Alfred. I can copy them into the global macro group (and remove the keyboard shortcut), but then will have to change them in two places whenever I want to adapt them.

Macros can only be executed if they are active.

It is possible the system has changed such that the AppleScript is considered the active application, which would then disable the macros and make them inaccessible via AppleScript.

You can place the macros in a global group, and have a macro that is triggered by a hot key and executes the macro in the application-specific group.

But I suspect it depends on how you are executing the AppleScripts - they do not need to be applications themselves.

Remember that active doesn’t mean enabled in the Keyboard Maestro editor - it means active in the current context of OSX.

Your BBEdit Group macros will NOT be active when the Finder is the frontmost app.

Macros do NOT need to be global in order to be called by AppleScript, however you must enable the correct context during the call:

tell application "BBEdit"
end tell
tell application "Keyboard Maestro Engine"
  do script "A05CD4DF-0D6A-4185-B38X-3A3B65F27ECN"
end tell

I’m not using Yosemite yet, so perhaps someone can indulge me and test.


I am running Yosemite and confirm that your Applescript below works fine. I substituted your Keyboard Maestro script UID with a script on my machine that beeped two times. BBEdit came to the front and I heard it beep twice when I ran the Applescript from Script Editor.

. . . Stephen

Hey Stephen,

That’s exactly what my test script did. :smile:

Thanks for testing for me.


Would be kind to share your code… :smile:

Hey Bill,

See post #13 in this thread.

I’m merely activating a macro via its UUID via AppleScript.

If I’m misunderstanding your request please expand on it.


1 Like