Skip to content

Instantly share code, notes, and snippets.

@Slruh
Created April 27, 2021 12:19
Show Gist options
  • Save Slruh/bc71f4b7a04497847175b2c83f8c446c to your computer and use it in GitHub Desktop.
Save Slruh/bc71f4b7a04497847175b2c83f8c446c to your computer and use it in GitHub Desktop.
Toggle Mute/Unmute of Google Meet from AppleScript
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