How to jump between two volume levels quickly?
I'm on a MacBook with a touchbar – that's how I control volume levels.
In practice, I only use two volume levels: "silent" (two bars) and "loud" (13 bars). It is a bit annoying to go through all the in-between levels when I want to go from one to the other.
Is there a trick or a touchbar app to allow me to define "silent" and "loud" levels and then jump between them quickly?
You can control the volume with AppleScript. For example:
set volume output volume 100
will set the volume to 100%
set volume output volume 5
will set it to 5%.
Via shell script, the commands would look like this:
osascript -e 'set volume output volume 100'
So that's part one: how to jump between 2 volume levels.
Part two is "How do I invoke those commands?"
I don't know any way to do it via the Touch Bar, but if I was committed to using that, I would look at BetterTouchTool.
My preferred solution would be a keyboard shortcut using Keyboard Maestro.
You could also use FastScripts.
You could set it up as an Automator Quick Action (Service) containing a simple toggle-switch Applescript
Applescript volume runs from 0 to 100 so doesn't precisely line up with a whole number of bars, so you may need to juggle the two values until they're comfortable. Using 50 as an arbitrary comparison allows for if it's ever been adjusted manually to anything other than these two defined volumes.
on run {input, parameters}
set currentVolume to output volume of (get volume settings)
if currentVolume is less than 50 then
set volume output volume 80
else
set volume output volume 20
end if
return input
end run
Save as 'Volume Toggle' so you can find it in Services, then you will find it right at the bottom of the list in System Prefs > Keyboard > Shortcuts > Services, where you can set an 'action' command to trigger it - e.g. Cmd ⌘ Opt ⌥ Shift ⇧ V (chosen so it won't conflict with anything else).
You may need to logout & back in for the shortcut to fully register system-wide.
Using this method will not provide any visual feedback as to the resulting volume setting.