Scripts for getting and setting the system volume in MacOS.
Open “Script Editor” which you can find in the Applications ➜ Utilities folder. Create a new document.
Enter and run a script:
Get the current System Volume settings
Script: get volume settings
Result: output volume:58, input volume:100, alert volume:100, output muted:false
Set the current System Output Volume
Script: set volume output volume 68
Result: empty but the volume will change
Creating convenient volume scripts
I found it very convenient to create a menu in my system menu bar with all my calibrated volumes.
First, enable Apple Scripts in the desktop’s menu bar.
Now we create a script for each SPL. The default location for user scripts is Library/Scripts
in your home directory. Conveniently, the Script Editor menu bar has an option to “Open Scripts Folder” for “User Scripts”.
Now…
60dB
system volume is 71
so set volume output volume 71
Volume 60dB.scpt
<home>/Library/Scripts
Repeat for other volumes.