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.
- Press:
⌘ + spacebar
- Type:
Automator.app
- 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
.
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.
Now you should see the Quick Action wizard.
In the first drop-down, select no input
.
Now apply focus to the search bar inside of Automator. Here we will filter for the Quick Action we need:
- Click in the search bar
- Type:
Run Applescript
Once you have filtered the Actions, double-click onRun AppleScript
.
Inside of the AppleScript action, delete all of the default AppleScript.
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.
Test That The AppleScript Works
- Press:
⌘ + spacebar
- Type:
Sound
- Press:
Enter
Once the Sound modal opens, click the Input
button.
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 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
.
The Save modal will open inside Automator. Save the workflow as mic-toggle
and click Save.
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
- Press:
⌘ + spacebar
- Type:
Security & Privacy
- Press:
Enter
Within Security & Privacy settings, click on the lock icon located at the bottom-left of the modal window.
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.
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.app
is selected, click the Open
button.
Validate that Automator shows up under the applications you want to allow to control your computer.
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
- Press:
⌘ + spacebar
- Type:
Keyboard
- 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.
Add the Shortcut
- Click on
mic-toggle
service from within the keyboard settings. - Click the
Add Shortcut
button. - 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.
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.
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.
- We created an Action workflow called
mic-toggle
via Automator. - We granted access to Automator to allow it to run Actions via the Security & Privacy settings.
- 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!