Skip to content

Instantly share code, notes, and snippets.

@marshallino16
Created December 13, 2016 13:16
Show Gist options
  • Save marshallino16/2ad537ebeaefa6800bfaec285db6082d to your computer and use it in GitHub Desktop.
Save marshallino16/2ad537ebeaefa6800bfaec285db6082d to your computer and use it in GitHub Desktop.
Max OS - Switch output sound source applescript
set asrc to "__Your Source Name__"
tell application "System Preferences"
reveal anchor "output" of pane id "com.apple.preference.sound"
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