Last active
December 10, 2015 03:58
-
-
Save mbierman/4377365 to your computer and use it in GitHub Desktop.
Set the Audio Output on OSX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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