Applescript error "System Events got an error: Script Editor is not allowed assistive access."
I made this script to pooling the "Citrix Viewer" application and avoid be disconnected by time-out.
set appName to "Citrix Viewer"
repeat while application appName is running
tell application appName to activate
tell application "System Events"
click at {1, 1}
end tell
delay 300
end repeat
It works well in "Catalina" but now in "Big Sur" this error appears:
error "System Events got an error: Script Editor is not allowed assistive access." number -25211
I already added and granted access for Script Editor (and even System Events) for "Accessibility Access" in System Preferences > Security & Privacy tab for both Accessibility and Automation services.
Any ideas or advice?
MacBook Pro (2020 and later)