Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use applescript to control the noise canceling of AirPods Pro?

Tags:

applescript

I want to implement a alfred workflow to control my AirPods Pro to switch between "Transparency Mode" and "ANC Mode". How can I write an apple script to simulate click on "audio" menu bar to switch noise-canceling. Or there is a better solution?

like image 726
Vxider Avatar asked Oct 28 '25 08:10

Vxider


1 Answers

Apple Script does not directly offer a way to control the noise cancellation option of AirPods (as of May 2024).

However, I found that Apple Shortcuts has a command to control the noise cancellation state ("Set Noise Control Mode") of your AirPods ✅

Here's the alternative I've come up with

  1. Create two shortcuts that (a) enable noise cancellation, and (b) enable transparency.
  2. Then, use Shell, Apple Script, Alfred, Keyboard Maestro, etc. to fire these shortcuts

Shortcut templates

a) ANC: https://www.icloud.com/shortcuts/97d28a992f3d44c8b5d94bfb86d11b2f
b) Transparency: https://www.icloud.com/shortcuts/fb14b09e390141acb58690198be81016

Note

Those shortcuts start with a script that detects which headphone is connected to the MacBook; this improves behavior, as trying to change the noise control mode of unconnected headphones will either cause a delay (about 5 seconds) or connect those headphones to the current device (i.e., disconnecting them from any other device they're currently used on)

Calling the shortcuts

Shell

  • shortcuts run "AirPods Noise Cancellation"
  • shortcuts run "AirPods Transparency"

AppleScript

  • tell application "Shortcuts Events" to run shortcut "AirPods Noise Cancellation"
  • tell application "Shortcuts Events" to run shortcut "AirPods Transparency"
like image 197
Philipp Avatar answered Oct 30 '25 15:10

Philipp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!