Skip to content

Instantly share code, notes, and snippets.

@erickvieira
Last active July 12, 2022 12:28
Show Gist options
  • Save erickvieira/ff3424614df9cae9acb51cba9a8ffe84 to your computer and use it in GitHub Desktop.
Save erickvieira/ff3424614df9cae9acb51cba9a8ffe84 to your computer and use it in GitHub Desktop.
Automator service for microphone mute key binding on Mac OS
on run {input, parameters}
set inputVolume to input volume of (get volume settings)
if inputVolume < 60 then
set inputVolume to 60
set displayNotification to "Microphone is unmuted"
set speechMessage to "unmuted"
else
set inputVolume to 0
set displayNotification to "Microphone is muted"
set speechMessage to "muted"
end if
set volume input volume inputVolume
say speechMessage
display notification displayNotification
delay 0.05
return input
end run
@erickvieira
Copy link
Author

erickvieira commented Feb 11, 2022

Mac OS Mic Mute

Configuration

  1. Create a new Automator service
  2. Add an AppleScript panel and paste the code inside it
  3. Save the workflow with the desired name (suggestion: "Mic Mute")
  4. Go to > System Preferencies > Keyboard > Shortcuts > Services, find your service by the name and bind a keyboard shortcut for it (suggerstion: control ⌘ /)

Usage

When you press the shortcut in your keyboard, a notification will appear and Siri will say the new microphone status ("Muted" or "Unmuted"). If you press again, it will toggle the previous known state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment