4

MacOS Ventura 13.3 but I have had some form of this problem on and off for a couple years.

I have a simple workflow that types the current date in ISO 8601 format, it is a single AppleScript action like tell application "System Events"...keystroke $DATE essentially. It breaks, often, with an error saying the workflow is "unable to send keystrokes". Perhaps something resets on OS upgrades, I'm not sure, but I wish I better understood the steps necessary to fix it. I gave Automator, AppleScript Utility, and the workflow itself the Accessibility permission "allow the applications below to control your computer"—as this answer says—but that alone does not seem sufficient (but might be necessary?). I don't see any relevant keyboard settings.

I suspect some or all of these apps also need to be on the Settings > Privacy & Security > Automation list...except there is no way to add (or remove, for that matter) apps to that list. There is no "plus" button and dragging an app onto the list does nothing. I've read here and in Apple's forums some suggestions that an app is supposed to request this permission the first time it needs it and to add an app to the list you should reinstall it. A fine solution...but you cannot reinstall Automator or AppleScript Utility, they cannot be deleted. The workflow itself also does not trigger a prompt for this permission, as far as I can tell, and I doubt giving it access would be enough. How is one supposed to add applications to the Automation list? Is there a CLI to this list?

5
  • Are you using an Apple Silicon Mac?
    – Thinkr
    Mar 29, 2023 at 16:35
  • @Thinkr no, Intel, 2019 pro.
    – phette23
    Mar 29, 2023 at 16:42
  • 1
    Out of left-field… is SIP disabled? Nothing will ask for perms if it is; it must be enabled.
    – Tetsujin
    Mar 29, 2023 at 16:56
  • 2
    csrutil status: System Integrity Protection status: enabled. And other apps are able to ask for permissions, I would've noticed a larger problem like that.
    – phette23
    Mar 29, 2023 at 17:17
  • Can you try checking Console output when you encounter the error, to see if there’s any more detail on the error?
    – deed02392
    Apr 28, 2023 at 23:08

3 Answers 3

2

The solution I found was this (Unfortunately, I think you will have to export under a new name every time you make a change in your application, so be sure to have finished before doing this.) :

  • Open your workflow in Automator.
  • Export your application under a new name.
  • Run it outside Automator by double clicking on it in the finder.
  • Accept all permissions : the one for the System events keystroke might get under a second one and go under all your opened windows. It will open System Settings Accessibility options where you can now authorize your new automator application.

Hope it works for you too! { 8 )-

1
  • So I tried this but couldn't quite follow your steps. If I export as a new workflow file, double-clicking that file just opens it in Automator again, it does not execute it. If I execute it from the Services menu (e.g. of a browser window or Notes app) I still receive the The action “Run AppleScript” encountered an error: “System Events got an error: Automator Workflow Runner (WorkflowServiceRunner, [appname]) is not allowed to send keystrokes.” error. There is no prompt to accept elevated permissions.
    – phette23
    May 10, 2023 at 18:05
2

In my case, it worked in the past, but something changed and it stopped working. The other suggestions didn't help, but I got it to work doing the following. If you're doing it for the first time you might have success starting at step 4.

  1. Open System Preferences > Privacy & Security > Accessibility
  2. Remove Automator by selecting it and then clicking the - button below the list.
  3. Close System Preferences to commit changes
  4. Run the Automator workflow from inside Automator
  5. Tricky Part: The permissions notification appears behind the Automator window, probably because Automator complains it doesn't have the permissions after the System notification appears. So just move the Automator window out of the way, and you should see the Security Permissions window, and click Open System Preferences
  6. Turn on permissions for Automator in Accessibility.

This is on an Intel-based Mac Mini 2018 running macOS Ventura 13.6.1

0

I don't know if this will work every time, but I got my workflow functioning again with these steps:

  • Open the workflow in Automator
  • Try to run it, error occurs (this step might not be necessary?)
  • Automator menu > Reset Warnings
  • Run the workflow again, no errors this time
  • Workflow works again

I can't explain why that works, it seems very odd, and there isn't even a prompt about permissions after "reset warnings", but it did the trick this time. There are no visible changes in settings (nothing was added to the Automation or Accessibility lists).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .