Skip to content

Instantly share code, notes, and snippets.

@vyruss
Last active December 8, 2023 19:23
Show Gist options
  • Save vyruss/f7e33bd802731f3c34f6fb991ee6b1d5 to your computer and use it in GitHub Desktop.
Save vyruss/f7e33bd802731f3c34f6fb991ee6b1d5 to your computer and use it in GitHub Desktop.
Reset audio balance on MacBook Pro (all recent Macs, really) - for the annoying OS X audio bug where your headphones or speakers balance is offset...
tell application "System Preferences"
activate
reveal anchor "output" of pane id "com.apple.preference.sound"
end tell
tell application "System Events"
delay 0.5
tell slider 1 of group 1 of tab group 1 of window "Sound" of process "System Preferences"
set value to 0.5
end tell
end tell
tell application "System Preferences"
quit
end tell
@vyruss
Copy link
Author

vyruss commented Jul 11, 2018

Reset Audio Balance

ResetAudioBalance.scpt

AppleScript which resets the audio balance to the middle on MacBook Pro (or any recent Mac, really) because:
MacOS X has this ancient unfixed bug with audio where your headphones' or speakers' balance becomes offset for no reason at all.

  1. Download the script and open it or copy and paste the code into Script Editor on OS X (tested on High Sierra).

  2. Go to FileExport... (see below)

    • Export As: "Reset Audio Balance"
    • Where: "Applications"
    • File Format: "Application"

    and Save.
    image

  3. Go to Applications and double-click on "Reset Audio Balance". You may have to go into:
    System Preferences_ → Security & PrivacyPrivacyAccessibility (see below)
    and click on the lock icon to authenticate and allow "Reset Audio Balance".
    If it doesn't appear there, click on the "+" button and choose "Reset Audio Balance" from Applications.
    image

  4. To get it to run automatically at startup, go to:
    System PreferencesUsers & Groups → Yourself → Login Items (see below)
    and click on the "+" button and choose "Reset Audio Balance" from Applications.
    You may have to choose the Password tab and Login Items again for it to appear.
    image

Credit: dubious_advice on Reddit

@FaultyJuggler
Copy link

I've been fighting with this and hunting for the right code, currently anything online similar giver

Syntax Error
System Settings got an error: AppleEvent handler failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment