2

Firefox is likely opening because the script includes: tell application "firefox"  … end tell Based on your description, these lines require AppleScript to launch Firefox to determine if the script is correct – even if the involved lines are never run. Firefox needs to be launched for AppleScript to obtain the application's scripting language ...


2

As basically explained in Apple Silicon: port all Homebrew packages under /usr/local/opt/ to /opt/homebrew (and in https://docs.brew.sh/Manpage#bundle-subcommand): Create a Brewfile with brew bundle dump Store the file somewhere safe (flash drive for instance) Once the computer is set up again, install Homebrew, copy the Brewfile back and run brew bundle ...


1

If you want to stop Firefox from opening when not necessary, then change: else if theActiveApp is "firefox" then tell application "firefox" open location urlToOpen end tell To: else if theActiveApp is "firefox" then set |Firefox| to "Firefox" tell application |Firefox| ...


1

There is a third-party utility named blueutil that makes it easy: blueutil --power toggle Toggles the Bluetooth power state. See the Usage section on the linked webpage for additional usage information. Note: If you do toggle the power state, turning Bluetooth off, make sure you can control your Mac's keyboard via USB or built-in if a notebook.


Only top voted, non community-wiki answers of a minimum length are eligible