Built-in way to mute audio on Catalina?
Question:
I need a short cut to mute my mac without using the touchbar, so no sound of taking a snapshot of my screen(cmd+shift+5 and control-click). I don't like third-party software I want a built-in way to do it.
My trying:
Oh, I forgot to save the changed. I've solved it with the following code:
if output muted of (get volume settings) is false then
set volume with output muted
else
set volume without output muted
end if
I found that the shortcut control+M didn't trigger the Automator, but command+shift+M works for me.
Solution 1:
First, you're going to need an AppleScript that can mute the system audio.
set volume 0
Now you need a way to execute this script from anywhere. We'll use macOS services, and Automator makes this super easy for us.
- Open Automator
- Make a New Document of type "Quick Action" (or "Service" in older macOS)
- Drag a new Run Applescript action into the workflow. You can find it in the Utilities category, or just search for it in the search bar.
- Copy the AppleScript shown above into the script box.
- Press ▶ to try it out.
- Save the workflow as
Mute System Audio
. The moment you save it, it will become accessible from the Services menu under the application menu.
Cool, now let's hook it up as a global keyboard shortcut.
- Open System Preferences
- Go into Keyboard Preferences
- Go to the Shortcuts tab
- Go into the Services category
- Scroll down to the bottom. Underneath General you should see Swap Front Windows.
- Select the "Mute System Audio" row, then click Add Shortcut.
- Enter the shortcut you want to use. I recommend Cmd + Ctrl + M.