14

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
    Commented Mar 29, 2023 at 16:35
  • @Thinkr no, Intel, 2019 pro.
    – phette23
    Commented 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
    Commented 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
    Commented 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
    Commented Apr 28, 2023 at 23:08

8 Answers 8

6

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

1
  • 1
    Your answer saved me. Weirdly, I had to do all the steps twice. I don't know if having other applications open affected it, so I closed and reopened the applications that shortcuts/automator were using. I have no idea if it affected it but eventually it worked. I put a similar answer here and credited you since it all came from you.
    – stevec
    Commented Apr 16 at 15:31
3

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
    Commented May 10, 2023 at 18:05
1

I want to point out an issue that I noticed only after I read about this extensively - if you change the application even a tiny bit, you have to regrant permissions in the way described in other answers (via Accessibility), and I had to rename the application in order to get it to reprompt and actually work. Quite the hassle!

1

What seemed to work for me was going into System Settings > Privacy & Security > Accessibility > toggling permissions OFF for Automator, Script Editor, Shortcuts and additionally for the Apple Scripts also listed here. I then quit the System Settings, then opened them again and re-enabled all three apps and the scripts. That allowed the Apple Scripts to run again without throwing errors.

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).

0

This was such a pain in the ass for me to set up as well, but what I ended up doing, was adding the following applications to allow accessibility features input monitoring basically everything under the settings and privacy section. I don't know why Apple keeps changing these things up every three months, but it's just a pain in th so make sure that you add Script Editor Automator shortcuts and...

what was important to me was actually Finder in the accessibility section

now my shortcut can enter text in any app without this annoying pop-up although it's still pretty slow compared to using a tool like better touch tool but unfortunately, Apple got rid of the touch bar which I think was Idiotic

0

I needed to add

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Support/AEServer

to Privacy & Security --> Accessibility

For some reason it is not automatically adding that any more.

0

I set up using Automator certain hotkeys to send text strings to applications (passwords)

I saw this on an M2 Mac, Sonoma 14.7.1; the solution was simple, Settings->Privacy and Security->Accessibility. Under "Allow these applications below to control your computer" I turned Automator off, then turned it back on again. The problem went away.

You must log in to answer this question.

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