This is a bit of a weird one...
If a particular AudioUnit file is installed on my system (i.e. is present in the "Components" folder), AppleScripts do not work when run from Keyboard Maestro.
They all fail (whether related to audio or not) with the message “osascript: can’t open default scripting component” - even the simplest "hello world" script.
(I'm 99.9% sure that when I was testing last week, the scripts failed however you ran them, but this week it seems to only happen when run from Keyboard Maestro).
This started a couple of weeks ago when I noticed that all the AppleScripts I had running from my Stream Deck had stopped working. On Googling, I found other people who had solved the problem by removing an AudioUnit Component file. In two cases it was FabFilter Pro C (a popular audio plugin).
In my case, it’s Hornet VU meter 4. All I have to do is remove it from the folder (no restart required) and my AppleScripts work. If I put it back in, they instantly stop working again.
I contacted the developer, and they have tried to reproduce the issue but everything works fine at their end. My guess is that this is actually an "Apple Problem" since other people have had it with different Audio Units, and since I have no idea why the mere presence of an Audio Unit file in the folder would affect unrelated AppleScripts.
Does anyone have any ideas? At the moment I have to live without this useful plugin so that my AppleScripts work.
(Additional notes: Mac mini 2018 Intel i3, macOS Monterey 12.6.2. The Plugin involved is Hornet VU Meter 4, which is an AudioUnit plugin for DAW's, but it's not actually running when the problem occurs. It just has to exist in the Components folder).