Running Keyboard Maestro 8.2.3 on macOS 10.12.6
I tested this script in both Script Debugger and KM, and it worked fine with no errors.
So it must be a Mojave Beta issue.
Make sure you are using the latest ver of KM, and have reset the KM Accessibility permissions. Although this should be fixed, you may have to do one or more of the following until it works.
- Restart the KM Editor
- Restart the KM Engine
- Restart your Mac