Skip to content

Instantly share code, notes, and snippets.

@henrik
Created November 21, 2020 23:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrik/38a7a76a217552d8f4fc672535fe91c5 to your computer and use it in GitHub Desktop.
Save henrik/38a7a76a217552d8f4fc672535fe91c5 to your computer and use it in GitHub Desktop.
AppleScript proof-of-concept for toggling Zoom mute. Gracefully handles Zoom not being installed, or not running, or not currently being in a meeting.
-- Based on: https://devforum.zoom.us/t/easiest-way-to-get-mute-status/18462/7
tell application "System Events"
if exists window 1 of process "zoom.us" then
tell application process "zoom.us"
if exists (menu 1 of menu bar item "Meeting" of menu bar 1) then
set meetingMenu to menu 1 of menu bar item "Meeting" of menu bar 1
set canMute to exists menu item "Mute audio" of meetingMenu
set canUnmute to exists menu item "Unmute audio" of meetingMenu
if canUnmute then
click menu item "Unmute audio" of meetingMenu
else if canMute then
click menu item "Mute audio" of meetingMenu
end if
end if
end tell
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment