Last active
December 8, 2023 22:14
-
-
Save lyallcooper/10f48ab050ac8594fe46335e49c99c46 to your computer and use it in GitHub Desktop.
AppleScript for toggling mute in Google Meet
This file contains hidden or 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
tell application "Google Chrome" | |
repeat with w in (windows) | |
set i to 1 -- tabs are one indexed | |
repeat with t in (tabs of w) | |
if URL of t starts with "https://meet.google.com" then | |
tell tab i of w | |
-- These selectors may be unstable, but seem to work well now | |
execute javascript "document.querySelectorAll('[data-is-muted]')[1].click()" | |
set muted to (execute javascript "document.querySelectorAll('[aria-label=\"Turn on microphone (โ + d)\"]').length === 1") | |
if muted then | |
display notification "Meet muted" with title "๐" | |
else | |
display notification "Meet unmuted" with title "๐" | |
end if | |
end tell | |
return | |
end if | |
set i to i + 1 | |
end repeat | |
end repeat | |
end tell | |
display notification "No active Meet found" with title "โ ๏ธ" subtitle "Could not toggle mute" |
can we have script for activating the DND mode when MS team video/audio or gMeet call started
@lyallcooper Thanks a lot, There is no update since 21 June 2021 to this project, do you have another alternative for me please?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This also works for the muted state and doesn't depend on a perfect match with the command character:
set muted to (execute javascript "document.querySelectorAll('[aria-label^=\"Turn on microphone\"]').length === 1")