My app wants to get the name of the frontmost window of another app, so I wrote a simple AppleScript to do that, which works fine in Script Editor.
When run from my Xojo app, the script initially resulted in a “Not authorized to send Apple events to System Events
” error, so I added “NSAppleEventsUsageDescription” and “com.apple.security.automation.apple-events” items to my app’s Info.Plist.
I got a notification once (can’t remember if it was when running the debug or compiled app) and accepted.
The situation now is that my built app appears in System Settings > Privacy and Security > Automation, with “System Events” switched on, and my debug app appears in System Settings > Privacy and Security > Accessibility, and is switched on. When either the debug or built app is run, DebugLog shows
“System Events got an error: myApp.debug is not allowed assistive access.
”
I’ve tried turning the Settings switches off and back on again, but haven’t been able to get a new prompt.
Any suggestions?