Created
November 21, 2011 01:17
-
-
Save incanus/1381351 to your computer and use it in GitHub Desktop.
AppleScript to use Display Audio as input & output devices
This file contains 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
tell application "System Preferences" to activate | |
tell application "System Events" | |
tell process "System Preferences" | |
click menu item "Sound" of menu "View" of menu bar 1 | |
-- set output | |
click radio button "Output" of tab group 1 of window "Sound" | |
set theRows to every row of table 1 of scroll area 1 of ¬ | |
tab group 1 of window "Sound" | |
repeat with aRow in theRows | |
if (value of text field 1 of aRow as text) ¬ | |
is equal to "Display Audio" then | |
set selected of aRow to true | |
exit repeat | |
end if | |
end repeat | |
-- set input | |
click radio button "Input" of tab group 1 of window "Sound" | |
set theRows to every row of table 1 of scroll area 1 of ¬ | |
tab group 1 of window "Sound" | |
repeat with aRow in theRows | |
if (value of text field 1 of aRow as text) ¬ | |
is equal to "Display Audio" then | |
set selected of aRow to true | |
exit repeat | |
end if | |
end repeat | |
end tell | |
end tell | |
tell application "System Preferences" to quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment