Skip to content

Instantly share code, notes, and snippets.

@sunnypp
Created December 28, 2017 01:56
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 sunnypp/63d6b3cf6f88d67fc655a1a8ab122a71 to your computer and use it in GitHub Desktop.
Save sunnypp/63d6b3cf6f88d67fc655a1a8ab122a71 to your computer and use it in GitHub Desktop.
AppleScript for switching sound output to Speakers
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