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)

Posted on Oct 12, 2021 1:01 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 12, 2021 3:12 PM

Well, just for the record, while the error remains a mystery, I was able to get work my script changing the click instruction by another. The code now is as follows:


set appName to "Citrix Viewer"

repeat while application appName is running
	tell application appName to activate
	tell application "System Events"
		keystroke tab using option down
	end tell
	delay 300
end repeat
3 replies
Question marked as Top-ranking reply

Oct 12, 2021 3:12 PM in response to Eduardo Rodriguez_Avila

Well, just for the record, while the error remains a mystery, I was able to get work my script changing the click instruction by another. The code now is as follows:


set appName to "Citrix Viewer"

repeat while application appName is running
	tell application appName to activate
	tell application "System Events"
		keystroke tab using option down
	end tell
	delay 300
end repeat

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript error "System Events got an error: Script Editor is not allowed assistive access."

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.