Any way to reset volume level after unplugging headphones?

I have a MacBook Pro, running Mojave, that I take between work and home.

When at home, I plug a set of speakers into the headphone jack and play music through the speakers. In order to get a reasonable volume level on the speakers, I need to crank the volume on the Mac all the way to the top.

I forget about that volume setting when I take it to work and put on some actual headphones, and then blow my ears out with the full volume!

Is there a way to make the Mac reset to a default (reasonably low) volume for the headphones after I unplug?


Solution 1:

You can use a third-party app like Keyboard Maestro or EventScripts to trigger a low volume setting script whenever you plug your headphone!

For exemple, with EventScript:

  • Click on Open Folder from EventScripts menu in order to open the scripts folder.
  • Add the script you want to be triggered, in your case something like do shell script "osascript -e 'set volume 1'" (note that set volume function works from 0 to 7, 0 being mute and 7 maximum volume).
  • Click on Choose Script from EventScripts menu and select the script to be used.
  • Add the event Headphone connected.

See my own setup as exemple to quit or launch Boom whenever headphone or Bluetooth device is found:

enter image description here