keystrokes

I created a program in Applescript. We are talking about the “System Events” and the “Keystrokes” command. Indeed, the program throws the error that the program in the event system is not allowed to send key entries. Before, I authorized my Applescript program in “Security and Privacy”, “Privacy” and “Accessibility”, “Full Disk Access” and “Files and Folders” and even in “Automation”. Note queue in the script format of Applescript the program function well. What is the problem?

Model: iMac
AppleScript: 2.11 (227)
Browser: Safari 605.1.15
Operating System: macOS 12

Maybe make sure that in Automation your application can control “System Events”

Sometimes, as soon as an app fails like, you can open the Security & Privacy, General Tab and see more detail about what failed and it may even let you fix it right there.

If none of that helps, you may need to reboot and try again.

You need in your case only “Accessibility” anchor of “Security & Privacy” pane. Otherways it is known as “Applications allowed to control you computer”.

When you create some application, which has the same name with some replaced application, it seems to you that you have added new application to this anchor. But the control is allowed to old application with same name. To add new application to this anchor remove old application (with same name) from “Accessibility” using “-”. Then, choose and add new application using “+”.