Skip to content

Instantly share code, notes, and snippets.

@lyallcooper
lyallcooper / meet-status.5s.scpt
Last active March 17, 2021 19:12
AppleScript for getting the current audio/video mute status of Google Meet
#!/usr/bin/osascript
-- Use this script in conjunction with a tool like xbar (https://github.com/matryer/xbar) to add
-- an audio/video mute status indicator to the menu bar.
--
-- ATTN: Make sure View > Developer > "Allow JavaScript from Apple Events" is enabled in Chrome
set separator to "\n---\n"
tell application "Google Chrome"
@lyallcooper
lyallcooper / toggle-meet-mute.scpt
Last active December 8, 2023 22:14
AppleScript for toggling mute in Google Meet
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

Keybase proof

I hereby claim:

  • I am lyallcooper on github.
  • I am lyall (https://keybase.io/lyall) on keybase.
  • I have a public key ASDY_vkvIT8r_2x1gJWDzWuxuCfVPhTXqZOGb0ncxlJauwo

To claim this, I am signing this object: