AppleScript Application is not allowed to send keystrokes

I also found though it is getting asked to allow your script with access to System Events it is not added to Security & Privacy if your script has spaces in it's name. I was struggling with this issue until I replaced space with an underscore. Then it was added here and worked fine since. My script with underscore instead of space:


I got a similar problem when updated to macOS 10.15 Catalina. I went to System Preferences -> Security & Privacy -> Accessibility and here I deleted my application and then added it again. After this, all work perfectly.