Keystroke command not working in shortcuts app

So I am using shortcuts app on MacOS Monterey. When try to run an AppleScript with Keystroke command in it I get an error message that says

"System Events got an error: Shortcuts is not allowed to send keystrokes."

Even I gave all the permission to Shortcuts app in privacy settings.

Is there any other way to do that in Shortcuts app?

Answered by Cwest4 in 698792022

I had the same issue, I was able to fix it by allowing both Shortcuts.app and siriactionsd in System Preferences > Security & Privacy > Privacy > Accessibility.

Accepted Answer

I had the same issue, I was able to fix it by allowing both Shortcuts.app and siriactionsd in System Preferences > Security & Privacy > Privacy > Accessibility.

Is this changed in Sonoma? this used to work fine

Can't find siriactionsd in Sonoma; what's weird is that when I have the Shortcuts app open and play a script which sends keys from there, it works when I just have added the Shortcuts app in the Accessibility settings. But when I trigger the script with a hotkey, I get the error, and I then have to remove and add the Shortcuts app in the Accessibility settings again to make it work again playing from the Shortcuts app.

After trying multiple combinations, what worked for me (in Sonoma 14.5) was granting permission in Privacy & Security > Accessibility to all of the following:

  1. assistant_service in /System/Library/PrivateFrameworks/AssistantServices.framework/Versions/A/Support/assistant_service
  2. Shortcuts
  3. Siri
  4. siriactionsd in /System/Library/PrivateFrameworks/VoiceShortcuts.framework/Versions/A/Support/siriactionsd

Hello! I am using the same system as you. How did you get into PrivateFrameworks from setting? I am in Privacy & Security > Accessibility but after clicking the + sign, in the Library folder I can't see PrivateFrameworks Thanks for sharing your solution btw!

In Sequioa 15.2 I was able to get the keystrokes working by:

  1. Creating an "Application" in the Automator.
  2. Adding the "Run AppleScript" Action to it, containing the keystrokes.
  3. Export it to my user's Application folder.
  4. Import the new Application in Shortcuts and adding it to the Dock.
  5. Open Settings > Privacy & Security > Accessibility.
  6. Making sure that all three Automator, Shortcuts and the new Application were added and enabled.

After a reboot it still works, but upon any change to the Shortcut (adding it to the Quick Actions for example) I have to disable and re-enable Shortcuts in Settings > Privacy & Security > Accessibility.

Note: Running the Shortcut from the menu bar completes normally without sending the keystrokes (also without any blocking notification).

Keystroke command not working in shortcuts app
 
 
Q