Toggle Mute in Google Meet

In my last post you learned I was moving on from the Bank to Workiva. The transition has been very interesting and I am enjoying the new work and the new team.

Workiva uses Google Meet for our teleconferencing solution. I’ve found that a browser based solution, although easy to use, requires you to have the Google Meet tab active to toggle mute within the meeting. Application based conferencing solutions (like Zoom, Webex, Teams) allow you to directly use AppleScript to control the mute function in the application.

I could just toggle the microphone on the Mac but I wanted a solution that directly muted the conferencing solution.

After a bit of research, I settled on writing some AppleScript, making it an application in Automator, and then executing the application with a button on my Stream Deck. Since I’m not a streamer or a hardcore gamer, I just have the Stream Deck Mini.

Build an Automator Application

Start Automator and select New Document, Application type, and then Choose to get an Untitled application:

Create a new Automator application.

In the search bar start typing Apple and drag the Run AppleScript Action to the right and drop it in the workflow area:

Add AppleScript action to the script

Replace the example code in the Run AppleScript action with the AppleScript code below:

on run {input, parameters}

    tell application "Google Chrome"
        repeat with theWindow in windows
            set i to 0
            repeat with theTab in tabs of theWindow
                set i to i + 1
                if URL of theTab starts with "" then
                    set index of theWindow to 1
                    set active tab index of theWindow to i
                    tell application "System Events" to keystroke "d" using command down
                end if
            end repeat
        end repeat
    end tell

    return input
end run

This code is also here.

Application with pasted code

To make sure it works, select the Run button. You will need to give permission for Automator to access the Google Cloud application. If you actually have a Meet going on, you will also need to allow Automator to send keystrokes. It’s probably best to not do that as you’ll need to do more security stuff below.

Select the Save… option in Automator and give your Application a name and save it to a known location on your drive.

Testing the Application

The easiest way to test the application is to start up a Google Meet in Google Chrome then run the application in Finder. You may be prompted for a number of permissions, allow them all.

In addition, you’ll need to add the application to the Accessability section of your Security & Privacy System Preference Panel. In the Privacy tab of Security & Privacy, select the Accessibility section, click unlock if needed to make changes, and then use the + to add your new application. This will allow your application to send the proper keystrokes to Google Chrome to mute and unmute the Meet.

Add application to security and privacy, accessability

Running the Application

Now that you have an application that will toggle mute in Google Meet, there are a number of ways to make it easy to use.

  • Add it to your Stream Deck (which is what I do)
  • Use Keyboard Maestro or some other keyboard macro application to tie it to a magic key
  • Add it to your dock and just click it when you want to toggle mute

Next Steps

  1. The application doesn’t return the current state of mute in the Google Meet and it would be nice to change some icon or other representation of mute. If I find the time I may do that as the next step.
  2. Occasionally the script gets an index error as it tries to assign the active tab in the meet window. I haven’t had time to debug it but if you reorder the tabs and try again, it works. I’ll try to track that down sometime.

Don’t use Chrome?

If you don’t use Google Chrome for Google Meet, change the application name in the script to the browser you use. No guarantees that it will work, but it is a start.