Can KM8 successfully run an AppleScript script that sends Apple Events to System Events? The only way I have found so far is to run such a script directly from Script Editor.
Hey Bill,
Certainly.
What version of macOS are you running and what version of Keyboard Maestro?
Please also post an example of a script that's failing for you.
-Chris
Thanks, I forgot to mention the critical fact that I'm running the release version of Mojave.
I haven't actually tried this in Keyboard Maestro 8.2.4 yet so it's more of a Mojave-AppleScript issue. So far, running the following example script any way other than directly from Script Editor fails, either silently or with an error message "AppleScript Execution Error. Not authorized to send Apple events to System Events. -1,743". Script Debugger won't run it for example.
tell application "TextEdit" to activate
tell application "System Events" to keystroke "Hello"
I suspect it's a Mojave bug, so am searching for a workaround, thus my inquiry into using KM8 to run it.
Quitting System Events at the top of the script allows it to work, including from KM8.
tell application "System Events" to quit
tell application "TextEdit" to activate
tell application "System Events" to keystroke "Hello"
I don't know if this is a Mojave bug, or a quirk specific to my computer.