An AppleScript "do script" is not running a Macro when called by name but runs it when called by UUID. Other test Macros don't respond to either.
versions KM 8.2.4 ; AppleScript 2.7 ; MacOS 10.13.6
This AppleScript is run from the Script Editor: tellapplication "Keyboard Maestro Engine" do script "4379B59B-EC3A-4E02-BB08-D92A178995A3" delay 2 do script "Decrease Sound Volume" endtell
The first call to do script works.
The second generates this error: Result: error "Keyboard Maestro Engine got an error: do script found no macros with a matching name" number -1
The UUID and the Name refer to the same Macro. (UUID came from "Copy as UUID")
Peter's checklist:
The normal cause for that is trying to execute a macro that either:
• Does not exist. (exists)
• Is disabled. (enabled)
• Not in application specific group (Global Macro Group)
• Is in a Macro Group that is disabled. (Group enabled)
• Is in a Macro Group that is currently inactive. (Group always active)
@JMichaelTX, I found the problem using "https://www.diffchecker.com/diff"
When I used your suggestion and copied the script from "Or by Apple Script:" it ran fine both ways -- UUID or name
So I compared my original script versus the script generated by "Or by Apple Script:" in DiffChecker.
The problem was immediately visible … two hidden characters had crept into the name during a cut and paste when I created the script. I don't remember where I copied the name from. Deleting those invisible characters in the name fixed the problem and the script runs fine now.
Thanks for your help.
@ccstone Thanks for your script to reverse lookup the name from the UUID. It used it and the result looked like I had the right name, but I did not know I had invisible characters in the name
It was diffchecker that spotted them
Please take a look at the image in the post above.