Mac 下 AirPods Pro 切换降噪操作如何设置快捷键?
没有菜单栏,导致没法通过 App 快捷键设置
没有菜单栏,导致没法通过 App 快捷键设置
Apple Script
tell application “System Events”
tell process “SystemUIServer”
click (menu bar item 1 of menu bar 1 whose description contains “volume”)
try
click menu item “nestim AirPods Pro” of menu 1 of result
if value of attribute “AXMenuItemMarkChar” of menu item “Transparency” of menu 1 of result is “✓” then
click menu item “Noise Cancellation” of menu 1 of result
return “Noise Cancellation active”
else
click menu item “Transparency” of menu 1 of result
return “Transparency mode active”
end if
on error
tell application “System Events”
key code 53
end tell
end try
end tell
end tell
来源:
https://www.reddit.com/r/AirpodsPro/comments/e6y2av/applescript_to_switch_between_noise_cancellation/
set AIRPODS_PRO_NAME to “你的 AirPods Pro”
set ANC to “降噪”
set TRANSPARENCY to “通透模式”
tell application “System Events”
tell process “SystemUIServer”
tell (menu bar item 1 of menu bar 1 whose description begins with “volume”) — find volume menu bar item
click
delay 0.1
tell (menu item 1 of menu 1 whose name contains AIRPODS_PRO_NAME) — find airpods menu item
click
tell menu 1 — open airpods menu
if value of attribute “AXMenuItemMarkChar” of menu item ANC is missing value then
click menu item ANC — switch to ANC
else
click menu item TRANSPARENCY — switch to Transparency
end if
end tell
end tell
end tell
end tell
end tell
来源 https://www.reddit.com/r/applescript/comments/hk2hh1/script_to_switch_airpods_pro_mode/