Archive. This is an archive of the Apple Support Community. Discussions are being restored and soon you will be able to read and post here again.

AppleScript-based Quick Action on macOS 27 "not allowed to send keystrokes"

I know that similar questions have already been asked in this forum, but could not find a solution: I have a simple AppleScript:


on run {input, parameters}
	tell application "System Events"
		keystroke return
		keystroke "c" using {command down}
		keystroke "o" using {command down}
	end tell
	return input
end run


When I try to execute it as a "Quick Action" (produced with the Automator application) named "copy name and open.workflow" on macOS 27.0.1, its execution gets denied with the error message: “System Events got an error: Automator Workflow Runner (WorkflowServiceRunner, copy name and open) is not allowed to send keystrokes.” The same Quick Action used to work on macOS before version 27. Note that "Automator.app", "copy name and open.workflow", "/System/Library/Frameworks/AppKit.framework/Versions/Current/XPCServices/WorkflowServiceRunner.xpc/Contents/MacOS/WorkflowServiceRunner", "Finder", and even "/System/Library/CoreServices/System Events.app" are enabled in "Device Control and Data Access" under "Privacy & Security" in the System Settings. I've tried to remove them from the list and to return them, restarted macOS, to no avail.


Any idea what has to be done to get the script to run?


I can't bite back remarking that I think it is an outrage that Apple offers automation features and then makes it impossible to use them—that I am not allowed to execute my own harmless trivial script on my own computer.




4 replies

Hi Jakov


I have written many Automator apps (not Quick Actions) that contain keystrokes and get the message “not allowed to send keystrokes”.


This has been solved in Sequoia and OSs before by adding the app (+ or drag and drop) into:


System Settings/Privacy and Security/Accessibility


 and then ensuring it is enabled.


Hope this is a step further to getting your Quick Action to work.

I duplicated you code in an Automator Quick Action - Run AppleScript that received no input in any application. By adding/enabling Automator to System Settings > Privacy & Security > Device Control and Data Access, the Quick Action runs without being blocked and opens a file chooser.



In my case, Automator was already added, but disabled which caused the security dialogs. Simply enabling Automator fixed the issue with this Quick Action.


Tested: macOS 27.0.1

Unfortunately I cannot edit my posting anymore. Here's what I wanted to add: Saving the Quick Action under a different name also did not help.

As I wrote: Automator.app is enabled in "Device Control and Data Access" and even removing and re-adding it from/to the list there did not help.