i made a little script that opens a Google translate Page with input from an prompt.
It works well with the hotkey or via the palette. But when i try to run it with applescript
tell application "Keyboard Maestro Engine"
do script "Translate"
end tell
it works a single time. If i want to call it again by applescript i get the error "do script found no macros with a matching name". The script still runs via the hotkey or palette but not with the script..
You can quote AppleScript by starting with a line:
```applescript
and ending with the line:
```
My guess is your macro group is no longer active after you run the macro, and so the macro can no longer be found (only macros that are active can be executed with the do script "Macro Name" command).
I tried that. At first its shown in the status menu and it works as usualy.
After some time it's no longer shown in the status menu - Thats the point when the macro is no longer triggered by applescript.
Thats very weird, since there is no other macro interfering with it at any time.
At that point, the macro is no longer active (either because the macro is disabled, or the macro group is disabled, or the macro group is inactive).
So I would look at the macro group settings unless you are actively disabling the macro or macro group via actions (which would show up in the editor).
i have an hotkey to show some macro palettes, the macro palette with the macro i mentioned shows up aswell.
While its shown the macro runs via applescript. But as soon as the palette is no longer visible the macro cant be triggered through applescript anymore.
It depends on the Macro Group settings, but traditionally yes, for a macro group that shows a palette then it is only active when the palette is showing.
However if it is configured with one of the Always activated and shows… variants, then the macro group will always be active, even when the palette is not showing.
Don't feel that way. Macro Group and Macro Activation is a complex topic, and can be hard to fully understand. Maybe this will help: Macro Activation .