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
Related Tags
automator × 1349applescript × 566
macos × 352
finder × 167
terminal × 149
script × 111
services × 84
command-line × 78
bash × 75
automation × 75
keyboard × 72
pdf × 64
mac × 40
mail.app × 34
safari × 32
folders × 27
screen-capture × 27
shortcut × 26
folder-action × 25
catalina × 23
itunes × 22
applications × 22
copy-paste × 22
email × 20
python × 19