Mac O’Clock
Published in

Mac O’Clock

How The Bleep: Mute Your Mic From Anywhere on macOS

Create a shortcut key that unlocks the ability to toggle your microphone between mute and unmute, anywhere on macOS.

You are likely here because you have been in this exact situation. You are on a virtual meeting, minding your own dang business, and attempting to get “higher priority” work done. Then it happens. Someone asks you a question.

Panic sets in. Your body starts dumping cortisol into your system while your keyboard foo navigates you through command-tab hell while simultaneously giving the universal finger signal that you need just a second.

Finally, you find the browser tab and unmute yourself to say…

“I’m okay with that.”

I know what you are thinking. The van I pulled up in with Free Keyboard Shortcuts spray-painted on the side looks kinda sketchy. I assure you, with a few simple steps and a few minutes, I will bring you one step closer to virtual meeting paradise… if there were ever such a thing.

The Tools You Will Need

  • A computer running macOS.
  • The ability to follow directions.

Creating The Workflow

Open Automator

The easiest way to open it would be via macOS’s Spotlight.

  1. Press: ⌘ + spacebar
  2. Type:Automator.app
  3. Press: Enter

Note: Automator should be opened. If you are presented with a dialog box about opening a file, ignore it. Just make sure you see Automator in the menu bar at the top-left of the screen and you should be okay to proceed.

Within the Automator menu bar, click onFile and select New .

The Automator Menu bar when creating a New document.

Create A New Quick Action

You will be presented with the quick action modal. Select Quick Action by clicking on the cog icon and then click the Choose button to get started.

The Automator quick document modal

Now you should see the Quick Action wizard.

A default view of the Quick Action modal inside Automator

In the first drop-down, select no input.

How the Quick Action wizard should look after selecting ‘no input’.

Now apply focus to the search bar inside of Automator. Here we will filter for the Quick Action we need:

  1. Click in the search bar
  2. Type: Run Applescript
Filtering available Actions inside of Automator

Once you have filtered the Actions, double-click onRun AppleScript .

The default view when you select Run AppleScript from the available Actions

Inside of the AppleScript action, delete all of the default AppleScript.

The Quick Action wizard after the default AppleScript has been removed from the Run AppleScript action.

Adding The AppleScript

Copy the following AppleScript to your Clipboard.

on getMicrophoneVolume()  input volume of (get volume settings)end getMicrophoneVolumeon disableMicrophone()  set volume input volume 0end disableMicrophoneon enableMicrophone()  set volume input volume 100end enableMicrophone
if getMicrophoneVolume() is greater than 0 then
disableMicrophone()else enableMicrophone()end if

Paste the AppleScript into the Run AppleScript action within Automator.

The Run AppleScript action once it has been updated with the mic-toggle AppleScript.

Test That The AppleScript Works

  1. Press: ⌘ + spacebar
  2. Type:Sound
  3. Press: Enter

Once the Sound modal opens, click the Input button.

The Input section of the Sound modal in macOS.

Speak and ensure the microphone monitor responds when you speak. Once you have validated that the microphone registers your voice, open up Automator. It is best to have these applications open side-by-side.

Click the left-pointing arrow to run the AppleScript.

The Run button inside of the Run AppleScript action

The microphone’s monitor should no longer respond to your speaking. If it did not work, go back through the steps and make sure you did not miss one. If it works as expected, click the Run button again to toggle the microphone back on.

Save Your Automator Workflow

With Automator open, go to the Automator menu bar. Click File and then click Save.

Saving a Workflow within Automator.

The Save modal will open inside Automator. Save the workflow as mic-toggle and click Save.

Saving the Workflow as mic-toggle.

We are done with Automator. Go ahead and quit Automator.

Granting Permissions to Automator

By default, Automator does not have permission to run actions. In order for mic-toggle to work correctly, we need to grant Automator access to do so.

Open the Security & Privacy Settings

  1. Press: ⌘ + spacebar
  2. Type: Security & Privacy
  3. Press: Enter

Within Security & Privacy settings, click on the lock icon located at the bottom-left of the modal window.

The macOS locked lock icon indicating you do not have access to modify permissions within macOS Settings.

Provide your credentials so you can allow changes to Automator’s permissions. You will know when you have done this successfully because the lock icon will be unlocked.

Once you have unlocked the Security & Privacy settings, click on Accessibility from the selection box on the left side of the modal window.

Selection of Accessibility within the Security & Privacy modal on macOS

Next, locate the + sign under the selection box on the right side of the Security & Privacy settings modal and click it.

Within the Finder modal that opens, navigate to the Applications directory. Once there, locate Automator.app and click it. Once Automator.appis selected, click the Open button.

Validate that Automator shows up under the applications you want to allow to control your computer.

The list of Applications that can be allowed to control your computer on macOS.

Great. Automator now has permission to run our AppleScript. Close that modal and lets create our keyboard shortcut

Configuring the Keyboard Shortcut

Open the Keyboard Settings

  1. Press: ⌘ + spacebar
  2. Type: Keyboard
  3. Press: Enter

Once the Keyboard Settings modal opens, click the Shortcuts button. In the left selection box, click Services. In the right selection box, scroll down until you find mic-toggle .

Note: If you do not see mic-toggle, head back over to Automator and make sure you saved the Workflow properly.

mic-toggle showing up as a Service inside of the Shortcuts section of macOS Keyboard Settings modal.

Add the Shortcut

  1. Click on mic-toggle service from within the keyboard settings.
  2. Click the Add Shortcut button.
  3. Press Shift + ⌘ + F12

Note: You can make the shortcut whatever you would like. Be careful. This is a global shortcut. You might override existing shortcuts or likely worse, turn on or off your microphone accidentally.

mic-toggle being updated with the Shift + Command + F12 shortcut

Test the Integration

To test that it works, follow the directions above where we opened up the microphone monitor. Press the keyboard shortcut that you provided and see if the microphone is turning on and off successfully. You might also take note that if you press the keyboard shortcut, you will see a cog icon in the macOS Menu Bar.

The cog icon represents Automator is doing work.

If during testing you are not seeing the microphone turn on and off again via the shortcut, retrace your steps and see if you misconfigured something somewhere.

That is it!

Congratulations, we are done! Let me recap quickly what we have done since the tutorial was verbose to ensure no steps were being assumed.

  1. We created an Action workflow called mic-toggle via Automator.
  2. We granted access to Automator to allow it to run Actions via the Security & Privacy settings.
  3. We updated the mic-toggle service with a keyboard shortcut.

I hope that this provides you a boost in your daily productivity when you are stuck in virtual meetings or hanging out with friends while we are stuck in quarantine.

Cheers and stay safe!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store