Created
April 27, 2021 12:19
-
-
Save Slruh/bc71f4b7a04497847175b2c83f8c446c to your computer and use it in GitHub Desktop.
Toggle Mute/Unmute of Google Meet from AppleScript
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
tell application "Google Chrome" | |
repeat with w in (windows) | |
set j to 0 | |
repeat with t in (tabs of w) | |
set j to j + 1 | |
set ti to title of t | |
if ti contains "Meet - " then | |
tell application "Google Chrome" | |
activate | |
end tell | |
set (active tab index of w) to j | |
set index of w to 1 | |
tell application "System Events" to tell process "Google Chrome" | |
perform action "AXRaise" of window 1 -- `set index` doesn't always raise the window | |
end tell | |
tell application "System Events" to tell process "Google Chrome" | |
keystroke "d" using command down | |
end tell | |
return | |
end if | |
end repeat | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment