Skip to content

Instantly share code, notes, and snippets.

@mbierman
Last active December 10, 2015 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbierman/4377365 to your computer and use it in GitHub Desktop.
Save mbierman/4377365 to your computer and use it in GitHub Desktop.
Set the Audio Output on OSX
set asrc to (choose from list {"Internal Speakers", "Living Room", "Girl's Room", "Master Bedroom"} with title "Sound Picker" default items {"Internal Speakers"}) as text
if result is "false" then return
-- for debugging
-- display dialog "src is: " & asrc
tell application "System Preferences"
reveal anchor "output" of pane id "com.apple.preference.sound"
-- Uncomment for debugging
-- activate
tell application "System Events"
tell process "System Preferences"
select (row 1 of table 1 of scroll area 1 of tab group 1 of window "Sound" whose value of text field 1 is asrc)
end tell
end tell
quit
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment