2

To use uBlock Origin in Safari 12.1.1, I run it using Extension Builder 1. But I have to go by the builder tool at every Safari startup, so the blog suggested adding the script to ~/Library/Scripts/Applications/Safari. I made the necessary folders, and put the script in .scpt format there. I also locked the com.apple.Safari.Extensions.plist preferences file as said.

But restarting Safari didn't prompt me for the password which it did, when I ran the script in Script-Editor. So I think it is not running.

How can I run the script at Safari start-up? Should it be put in some different folder, or different extension?

1 https://georgegarside.com/blog/macos/install-any-safari-extension-macos-mojave/

3
  • 1
    I do not believe a default install of Safari has the built-in ability to run an AppleScript script when it is launched. That said, I use an app called EventScripts that is capable of doing like that (and much more). Note that I'm not associated with the developer of this app, just a satisfied user. Commented Oct 24, 2019 at 17:42
  • This does work, and has Safari launch as a detectable event. But I'd rather assign a shortcut in the end, it being a free option :p.
    – anki
    Commented Oct 24, 2019 at 18:13
  • Worth an answer though! I don't yet, but people sure do pay for apps. And might be looking for such event triggered scripts.
    – anki
    Commented Oct 24, 2019 at 18:50

1 Answer 1

1

Safari won't automatically run the script on launch. The easiest way to run the script is to place the script in ~/Library/Application Scripts/com.apple.Safari, then you can run the script from the Script menu when Safari is running.

You can enable the Script menu if you haven't used it before from Script Editor, then the menu appears and shows all appropriate scripts. Enable the Application Scripts menu in Script Editor → Preferences → General under ‘Show Script menu in menu bar’.

I've updated the instructions on the linked blog post: Bypass ‘Safari no longer supports the unsafe extension’ in macOS Mojave: Next steps

You must log in to answer this question.

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