Used this all the time, but can confirm that with Ventura 13.0 released version, it still does not function under Ventura. Keep up the great work!
Hi, @spaceavian. Welcome to the Keyboard Maestro forum. Thanks for your report.
I'll add that it is still broken with macOS beta 13.1 (22C5033e).
Googling around I see that others have discovered this problem.
Interestingly, this AppleScript on a pre-Ventura system:
tell application "System Preferences" reveal pane id "com.apple.preference.sound" end tell
gets converted (on Ventura in the Script Editor–when compiled) to:
tell application "System Settings" reveal pane id "com.apple.preference.sound" end tell
(The conversion also occurs in a Keyboard Maestro Execute an AppleScript action.)
Although Preferences is automatically changed to Settings, the tell block fails on Ventura.
Same here. Fail!
Yes, @ikenassi, I think it's safe to say that AppleScript related to the System Preferences (now Settings) is no longer functioning. We can hope that it might come back, but Apple's track record in such cases is not strong.
On a related note, I was hoping that the macOS Shortcuts app might have built-in actions to change the Sound Output, but as of Ventura 13.1 Beta 1, it does not.
That AppleScript might fail, but the Open a System Preference Pane action can open the Sound preference pane.
Whether that helps any, I don't know.
Thanks for the heads up, @peternlewis. Since my comment above I had found a way to open the Sound System Setting in Ventura, but if Open a System Preference Pane works on all versions of macOS, that’s far superior. I will check it out.
Next challenge: Ventura AppleScript UI scripting.
I have a working sound control panel for Ventura. I just want to do some more QA on it before I release it. It only works for Ventura, of course. It was a true pain in the ass to get this one done. Look for it in the next couple of days, but it works on my Intel iMac and my MacBook Pro M1.
I created "Set input and output sound devices in MacOS Ventura" as you requested.
I've updated the OP with Version 4.0 of Set Sound Output:
When an error occurs, a message is displayed using Prompt For User Input rather than Display Text. With this change, the System Preferences (or System Settings) remain open when the error message is displayed.
Improved and simplified the localization in the AppleScript UI scripts: i) moved definition from AppleScript to the macro body, and ii) eliminated dependency on the word Output|Uitvoer|Ausgabe.
Why do you need to open the system settings sound pane in a loop? When I run it once, it just selects the sound pane.
@ikenassi, good question!
This is a general practice I use because it makes such steps more robust and the wait can be minimized. (I take a similar approach when a sequence of actions that depend on an application being in the foreground.)
Bottomline: it never hurts and sometimes helps.
Good idea. Better than dealing with variable delays.
By the way, here’s a little script to convert the OS version from (potentially) i.j.k to i.j so you can use numeric comparisons.
Set OS Version.kmmacros (3.96 KB)
Please ignore my poorly named local variable.
For a macro that sets the Sound Input as well as the Sound Output, see Set input and output sound devices in MacOS Ventura by @ikenassi.
Although the one I wrote works just fine, I've cut over to SwitchAudioSource.
As was said earlier, it's free, fast, and works well. Install with the Homebrew package manager by:
brew install switchaudio-osx
Shell script examples:
echo "All Sound Devices:" SwitchAudioSource -a echo "Input:" SwitchAudioSource -t input -c echo "Output:" SwitchAudioSource -t output -c
I have neither, so not tested.
Registered to say many thanks for this excellent Macro. It works extremely well on Ventura 13.0.1. Thank you @_jims
@OneEyedJack, you’re welcome. Glad you are finding it useful.