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:

enter image description here

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.

  1. Open Automator
  2. Make a New Document of type "Quick Action" (or "Service" in older macOS)
  3. 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.
  4. Copy the AppleScript shown above into the script box.
  5. Press to try it out.
  6. 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.

  1. Open System Preferences
  2. Go into Keyboard Preferences
  3. Go to the Shortcuts tab
  4. Go into the Services category
  5. Scroll down to the bottom. Underneath General you should see Swap Front Windows.
  6. Select the "Mute System Audio" row, then click Add Shortcut.
  7. Enter the shortcut you want to use. I recommend Cmd + Ctrl + M.