Facetime - Toggle Script for muting and unmuting the mic

Hi Everyone,
New to scripting, I was trying to figure out muting and unmuting using the Script Debugger for the app FaceTime… So far I have this.

activate application "FaceTime"
tell application "System Events"
	tell process "FaceTime"
		tell its window 1
			click button 5
		end tell
	end tell
end tell

This doesn’t seem to work, does anyone know how I can make this work?

macOS 12.6
Script Debugger v8.0.5 (8A61)

Hey Jack,

Welcome to the forum!  :sunglasses:

I can’t conveniently test this right now, and I’m still using Mojave – so that might interfere as well.

Nevertheless – here’s how I’d start working with this:

activate application "FaceTime"
# Make sure there's not a timing issue here.
tell application "System Events"
   tell application process "FaceTime"
      tell its window 1
         tell (first button whose accessibility description is "mute")
            return actions -- check the available actions
            # Then probably
            # perform action "AXPress"
         end tell
      end tell
   end tell
end tell

-Chris