I am trying the trial of UI Browser to try to figure this out, but I am failing.
Troubleshooting ideas on how to fix this?
tell application "System Events"
tell process "ControlCenter"
try
click (first menu bar item whose title is "Sound") of menu bar 1
tell scroll area 1 of group 1 of window 1
click (first checkbox whose title contains "AirPods Max")
end tell
end try
end tell
end tell
Hi Jim, still on Mojave so I can’t help with UI scripting here.
However to switch sound output I’m using switchaudio-osx for some years now. But I have to admit that I have no idea where I got it from (probably homebrew). It could be this.
I’m using it to switch from headphones to a custom setup (found on the web) in order to let me continue to listen to the tracks that I’d like shazam to detect. Great tool and definitely more reliable than UI scripting (but of course I don’t know the background of your question).
Yes, but you have to build it in XCode. I’ve never done this (still not started looking into XCode) but maybe someone who knows how to do it could build it for you?