I am writing a simple (haha) bash script that will send keystrokes to an app. It uses the osacript command line to do this, like so:
osascript <<EOSCRIPT
activate application "Mini vMac"
tell application "System Events" to keystroke "a"
EOSCRIPT
When this script is run, it does bring the app to the front, but then I get the following error:
77:90: execution error: System Events got an error: osascript is not allowed to send keystrokes. (1002)
I have tried whitelisting /usr/bin/osascript but other search results suggest that it doesn't want this. The bash script itself is unselectable (which doesn't necessarily mean that it doesn't want it, just that I can't check).
How do I force it to let me run this? 10.14.6 Mojave if it matters.