I've updated the OP with Version 6.0 of Set Sound Output:
-
Compatible with Set Sound Input, v1.0 or later. For more information see: Using 'Set Sound Output' and 'Set Sound Input' Together
-
Changed to a subroutine with parameters: Sound Output Name, Save Initial State, Exit Action. The macro can still be run by another macro using Execute a Macro specifying the Sound Output Name in the With Parameter field.
• Save Initial State : 0 (No); 1 (Yes); This saves the Running State and the Displayed Pane (if Running) in a Dictionary. This value can then be retrieved by another instance of this macro or the sister macro Set Sound Input.
• Exit Action : 0 (Initial State, i.e., the state when SSO started; i.e., Open|Closed, if Open, which Displayed Pane); 1 (Saved State, i.e., the state saved in the Dictionary by SSO or SSI); 2 (Open–to the Sound pane); 3 (Close). This value specifies the action to be taken with the System Preferences (or System Settings) after the Sound Input is set.
-
If this macro is triggered from the KM Editor, a dialog will appear that provides an option to create a calling macro that will use the Execute a Subroutine action.
-
Sound Output changes are made more quickly and are less likely to fail. For example, if AirPods are specified, but they are in the case when the macro is launched, the macro will continue searching for a few seconds as the AirPods are removed from the case.