Updated Mono-Stereo Toggling
Apple changed a few things in System Preferences under Mojave which broke this script to toggle between Mono and Stereo output.
Here is the fix. You will note that it is a simple change to the line targeting the System Preferences' Accessibility window.
tell application "System Preferences"
reveal anchor "Hearing" of pane id "com.apple.preference.universalaccess"
end tell
tell application "System Events"
tell application process "System Preferences"
set frontmost to true
tell group 1 of window "Accessibility"
# pre-Mojave - replace the line above with the one below
# tell window "Accessibility"
set monoStereoCheckbox to checkbox "Play stereo audio as mono"
if (get value of monoStereoCheckbox) as boolean is true then
set ddMessage to "Switch to STEREO output?"
else
set ddMessage to "Switch to MONO output?"
end if
if button returned of (display dialog ddMessage buttons {"No", "Yes"} default button 2) is "Yes" then
tell monoStereoCheckbox to click
end if
end tell
end tell
end tell
if application "System Preferences" is running then
tell application "System Preferences" to quit
end if
For more details, read the original post.