How to Create a Hot Key to Change Sound Devices in System Preferences

Try this one for that combination...

Download: Set Sound O-Display Audio I-SSL 2.kmmacros (29 KB)

Macro-Image


Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 13.3.1 (22E772610a)
  • Keyboard Maestro v10.2

And this one for that...

Download: Set Sound O-SSL 2 I-SSL 2.kmmacros (29 KB)

Macro-Image


Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 13.3.1 (22E772610a)
  • Keyboard Maestro v10.2


If the two macros work individually, you could assign a hot key for each or if you assign the same hot key you will see a Keyboard Maestro Conflict Palette and be able to select from the palette.

1 Like

Hi _jims,

This worked perfectly. The second time I put that macro I just changed it to call the display audio instead of the SSL 2.

This works as well as I had ever hoped. I had no idea it was so complex. I think Apple programming and me are not necessarily a good mix.

I very much appreciate your patience, your kindness and your expertise in this.

You have really inspired me to keep learning.

Thanks again.

1 Like

Hi, @Ken1,

Previously you mentioned that you liked the idea of toggling between sound settings. If you'd like to do that with your two combinations of Output/Input, you could use this macro.

Download: Toggle Sound Output and Input (@Ken1).kmmacros (11 KB)

Macro-Image


Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 13.3.1 (22E772610a)
  • Keyboard Maestro v10.2

If I would only want to choose / toggle btw 2 Output sources, would the script not be simpler?

So I wrote

Set Sound External Headphones (for Macro 1)

and

Set Sound Mac mini Speakers (for Macro 2)

The macro is firing, but something doesn't work. What could it be?

Any assistance will be much appreciated.

OmarKN

Hi _jims,

When I first tried it, it did make a change. Then it sends an error and cancels the macro.

Here is a screenshot so you can see.:

I'm using the two with the arrows, and they work really well.

@Ken1, clearly I'm confused regarding your macro requirements. Above I read...

After reading that, I uploaded two macros:

  • Set Sound O-Display Audio I-SSL 2
  • Set Sound O-SSL 2 I-SSL 2

But in your latest screenshot I see:

  • Set Sound O-Display Audio I-Display Audio
  • Set Sound O-Display Audio I-SSL 2

I set up the Toggle macro using my assumptions, which appear to have been incorrect.

If you want, you can try to change the Toggle macro to meet your requirements.

First set up this section to include the two Output/Input combinations you want:

Then move down in the macro and click on these entries and select the two matching macros:


Or alternatively, you can delete the Toggle macro and just continue to use the two macros that you say are working well for you.

Hope that helps!

I’m really sorry my ignorance is causing this problem.

Thank you for your guidance. Thank you for uploading the changes and for everything you’ve done to help me.

I’m sorry that this has been difficult. I’m extremely grateful for your help.

1 Like

Hi, @okn; yes, it would a little faster, but you'll still see the System Preferences (or System Settings) open. Here's what you can do:

  1. Download and install: Set Sound Output

  2. If you want to set a sound output to an explicit device, then run Set Sound Output from the Keyboard Maestro Editor. Do this for each of your devices. For more information, see the description above the download link or the comments within the macro.

  3. If you want to also be able to toggle between two devices (as you mentioned), then download and install: Toggle Sound Output

  4. Refer to the Toggle Sound Output header comment. You'll see that you'll need to enter the name of both output devices.

Feel free to follow-up with addition questions, @okn.