Skip to main content
Became Hot Network Question
edited tags
Link
bmike
  • 245.5k
  • 80
  • 442
  • 1k
Source Link

Why am I getting “Unable to Run JavaScript on Web Page” in Apple Shortcuts, even though my script works?

I am trying the “Run JavaScript on Web Page” action in Apple Shortcuts with this simple script:

alert("test"); completion(result); 

The alert fires and shows a message. However, I keep getting this error box at the end:

“Unable to Run JavaScript on Web Page. Make sure that ‘Allow JavaScript from Apple Events’ is enabled in the Develop menu in Safari. The Develop menu can be enabled in the Advanced section of Safari’s Preferences.”

I’ve already verified and tried:

  1. JavaScript is enabled in Safari.
  2. The Develop menu is activated.
  3. “Allow JavaScript from Apple Events” is checked.
  4. Restarted both apps
  5. Rebooted
  6. Ran defaults write -app Safari AllowJavaScriptFromAppleEvents 1

What could be causing this issue, and how can I resolve it?