Control sound panel in OS X system settings

I would like to control where the sounds output is directed to in the OS X system settings. So, e.g. have a key for “headphone activate”, or “USB sound devices”. Can someone help me how I would best do that? Thanks!

EDITED: Change the link and comments. Well, pretty-much the entire post. :slight_smile:

Try this:

It's the last post in the topic (or was when I posted this, anyway). It looks like it's probably the best solution, if I read the thread correctly.

Thanks Dan! I’ll give a try.

An alternative is to use mouse clicks. Mouse clicks are usually a last resort but the following macro never fails for me, probably because Preference Panes are a fixed size.
The first mouse click selects the Output button of the Sound Preference Pane. In this marcro the second mouse click selects the USB output. If it happens that the USB output is already selected there is no change.

For selecting Internal Speakers duplicate the macro, assign it a different name and trigger and change the coordinates of the second mouse click to, in my case, 275:150.

You may have to change the click coordinates to suit your monitor. To do so open the Sound Preference Pane, activate the appropriate Move and Click dialogue, click the Get button in the Move and Click dialogue and, within five seconds, move the pointer to and click in the middle of the desired button or bar in the Sound Preference Pane.

The macro can be duplicated and adaped to work with Sound Input.

Trying to download zip file but get this message:Oops! That page doesn’t exist or is private.

What specifically were you trying to download?

Hmmm. That's not my post - I only pointed to it.

I suggest you to to this post from @ccstone, and reply to it:

Thanks a lot.I found the original post but the link is still unavailable.

@ccstone Chris - What happened to the zip file in the post below?


Something funny's going on with the link. (Peter's investigating.)

See the original thread for more.

-Chris (107.1 KB)

Here is the original file. I haven't had the time yet to try it out myself.

I think I found a solution! I searched for existing applescripts (not yet knowing much about how to write them) that would allow me to select an output when my laptop is plugged into a dock via USB.

Eventually found this applescript by Vivek Gani at

Set up KM macro to look like this: