- Open Automator.app
- Create new Quick Action
- Select Run AppleScript
- Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
set inputVolume to 100
display notification "Volume set to 100" with title "✅ Microphone is on"
else
set inputVolume to 0
display notification "Volume set to 0" with title "❌ Microphone is off"
end if
set volume input volume inputVolume
- Save as
mute-microphone
- Go to System Preferences -> Keyboard -> Shortcuts -> Services -> General
- Find the
mute-microphone
service and set the hotkey (e.g. control-cmd-option M)
At first, I was frustrated that @henrik242's script didn't work for me. I suspect that many of you may be running into the same issue I had.
The problem for me was that my Shure Digital X2U microphone input had no way of digitally muting it:
![Screenshot 2024-02-23 at 3 25 10 AM copy](https://private-user-images.githubusercontent.com/919072/307215446-799434ea-be36-4c86-8dc4-53174a0674d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNzE3MzQsIm5iZiI6MTcyMDE3MTQzNCwicGF0aCI6Ii85MTkwNzIvMzA3MjE1NDQ2LTc5OTQzNGVhLWJlMzYtNGM4Ni04ZGM0LTUzMTc0YTA2NzRkOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNVQwOTIzNTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZGM5ZGZiNDkyOWQ3Y2VkZjRmZWMwNDVlMzE0Yzc0ZWM5NGZmYmEyNzAwNmU3ZjlhZDU1NzNiM2YxMjUyNmEyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.yAdVroY5IgjIwXz-bhla4-apOhrK9AGLtCDGJ156Ass)
My solution was to create a Loopback device using the aptly named app called Loopback with the following simple configuration:
![Screenshot 2024-02-23 at 3 25 56 AM copy](https://private-user-images.githubusercontent.com/919072/307215826-537dfdbd-db15-442a-959e-4c0f33157fcd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNzE3MzQsIm5iZiI6MTcyMDE3MTQzNCwicGF0aCI6Ii85MTkwNzIvMzA3MjE1ODI2LTUzN2RmZGJkLWRiMTUtNDQyYS05NTllLTRjMGYzMzE1N2ZjZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNVQwOTIzNTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lYTg3MjQ0NWZiYzIyYzdmNmYyNTZmNmUxNjZkM2M1ODg1MmNmM2MzOGU3MGY1YmMxMmEwZThhN2Y1OGMzMjBhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.6FM9Fy1CNc6fMyKrT-sTuF4kw9t0e4PwoExw7NhhEn0)
I now have a device that I can select as my input that has an "input volume" slider:
![Screenshot 2024-02-23 at 3 25 14 AM copy](https://private-user-images.githubusercontent.com/919072/307215886-99efc504-9025-467a-900a-6e305e826b58.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNzE3MzQsIm5iZiI6MTcyMDE3MTQzNCwicGF0aCI6Ii85MTkwNzIvMzA3MjE1ODg2LTk5ZWZjNTA0LTkwMjUtNDY3YS05MDBhLTZlMzA1ZTgyNmI1OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNVQwOTIzNTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05ZmExY2RkZmJkYTlmMTJhZmM0OGRhZWNmOGY2NzZlYzA0MTZkOTkyZWYxZWVhNjkwZGY3ZWY5Yjc0NmUwNDY0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.OEL8oElKDKGn7Kf4K05L-LfzSBsIQiVp0DnrdfI99Us)
Problem solved! Now @henrik242's unmodified AppleScript works flawlessly on macOS Sonoma 14.3.1.
I got the script itself to run instantly using a keyboard shortcut in FastScripts.
Additional notes:
Automator: I too have noticed in the past that using Automator is slow. Don't bother, unless you need something free.
BetterTouchTool: This works in BetterTouchTool as well, but the "display notification..." doesn't work; you'll have to use the built-in one, but that one can't alternate between Muted/Unmuted notifications.
So, ideally just use FastScripts for this.
I also slightly tweaked @henrik242's script as follows, incorporating some of the flourishes of others:
You can link others to this solution here.