Change Airpods Pro Noise Cancellation Mode

Does anyone have a good way to change the Noise Cancellation Mode for Airpods Pro on Mac? I was looking to use hotkeys to change the mode.

I was excited to see a Shortcut action, so that I can use KM to trigger it.

image

But when I run it, it says

image

Although I chose the device from the dropdown list of the Shortcuts action and was using it at the time of execution.

This AppleScript will turn on Noise Cancellation if the AirPods are already connected:

tell application "System Events"
	tell application process "ControlCenter"
		try
			click menu bar item "Sound" of menu bar 1
			tell window 1
				UI elements
				tell scroll area 1
					click (first checkbox whose title contains "Cancellation")
				end tell
			end tell
		end try
	end tell
end tell
1 Like

Thanks, Jim.
It works when I'm not in the full screen video mode. When I'm in the full screen video mode, it only shows the menu (the first click), but does not execute the 2nd click.
If there is a way to make the Shortcuts to work, it would be great, as it does it in the background.

1 Like

It looks like I am able to execute the Shortcuts on iOS devices and not on MacOS. I think I'll live with that.