osascript-audio
System audio control via AppleScript volume commands and system_profiler.
All scripts are pure Python — no JXA needed for basic audio control.
Volume API
AppleScript volume settings returns a record with all four levels:
output volume— speaker/headphone volume (0–100)input volume— microphone level (0–100)alert volume— system alert sounds (0–100)output muted— boolean
Scripts
Get current volume levels or set output volume (0–100):
uv run scripts/volume.py
uv run scripts/volume.py --set 75
uv run scripts/volume.py --set 0
Mute, unmute, or toggle output audio — --status to check current state:
uv run scripts/mute.py --toggle
uv run scripts/mute.py --on
uv run scripts/mute.py --off
uv run scripts/mute.py --status
List all audio input/output devices via system_profiler SPAudioDataType:
uv run scripts/audio-devices.py
Key AppleScript Patterns
-- get all levels
get volume settings
-- set output volume
set volume output volume 75
-- mute / unmute
set volume with output muted
set volume without output muted