Created
November 21, 2020 23:24
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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