Created
December 28, 2017 01:56
-
-
Save sunnypp/63d6b3cf6f88d67fc655a1a8ab122a71 to your computer and use it in GitHub Desktop.
AppleScript for switching sound output to Speakers
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 Preferences" | |
reveal anchor "output" of pane id "com.apple.preference.sound" | |
end tell | |
tell application "System Events" to tell process "System Preferences" | |
tell table 1 of scroll area 1 of tab group 1 of window 1 | |
select (row 1 where value of text field 1 is "Internal Speakers") | |
end tell | |
end tell | |
quit application "System Preferences" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment