Created
January 9, 2018 08:09
-
-
Save stephonchen/fca7605ac82d5267a638d4d604b70255 to your computer and use it in GitHub Desktop.
Reset sound balance through CLI, using OSAScript
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
#!/usr/bin/osascript | |
(* Set Volume to 100 *) | |
set volume 100 | |
tell application "System Preferences" | |
activate | |
set current pane to pane "com.apple.preference.sound" | |
reveal (first anchor of current pane whose name is "output") | |
end tell | |
tell application "System Events" | |
launch | |
(* Set sound balance to 0.5 (center), 0 -> left, 1 -> right *) | |
tell process "System Preferences" to tell slider 1 of group 1 of tab group 1 of window 1 to set value to 0.5 | |
end tell | |
quit application "System Preferences" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment