Catalina: How to add System Events to System Preferences > Security & Privacy > Privacy > Automation? The problem
In a script I'm using AppleScript to reload the browser when a change happens. I start this in the builtin terminal of my IDE, WebStorm.
Since MacOS Catalina this yields the following error:
English
execution error: System Events got an error: osascript is not allowed to send keystrokes. (1002)
German/Deutsch
execution error: „System Events“ hat einen Fehler erhalten: osascript ist nicht berechtigt, Tastatureingaben zu senden. (1002)
The solution
I added /usr/bin/osascript and WebStorm.app via 'Choose File' dialog to System Preferences &gt; Security &amp; Privacy &gt; Privacy &gt; Accessibility (German/Deutsch:   Systemeinstellungen &gt; Sicherheit &gt; Datenschtuz &gt; Bedienungshilfen).
But since Catalina/Mojave it must also appear under the new section Automation. Only there is no 'Choose File' dialog and when running the script no confirmation dialog pops up so (un)checkable entry is created.
How can I allow System Events under System Preferences &gt; Security &amp; Privacy &gt; Privacy &gt; Automation?
osascript -e 'tell application &quot;System Events&quot;' -e 'keystroke &quot;echo hi&quot;' -e end tell
will add an entry System Events under ther terminal emulator where you run it from in the automation section.

If you receive execution error 1002 again, uncheck and recheck System
Events under Automation again.
If you receive  execution error -1743: Remove the app from the Accessibility/Bedienungshilfen section and add it again

execution error: Not authorized to send Apple Events to System Events. (error -1743)
execution error: Keine Berechtigung zum Senden von Apple-Events an System Events. (-1743)


If you receive execution error -1719: Add /System/Library/CoreServices/System Events.app to Accessibility/Bedienungshilfen via 'Choose File' dialog

execution error: System Events got an error: osascript is not allowed assistive access. (-1719)



Possibly lock and unlock between rechecking/readding or run multiple times or prefixed by sleep 1 &amp;&amp;. These new security settings unfortunately still seem a bit messy (good links for further reading there!):

Hopefully this gets worked out before Mojave ships.

Nope :-(
By the way, osascript -e 'tell application &quot;System Events&quot;' -e &quot;keystroke key code 53&quot; -e end tell ran twice will add the entry for the program itself under the program.