# Osascript Audio

> Control macOS system audio via osascript. Use when getting or setting system volume, toggling mute, listing audio input/output devices, or checking which device is the default output.

- Skill: `damionrashford/osascript-audio` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add damionrashford/osascript-audio`
- Raw SKILL.md: https://api.skillmd.com/api/skills/damionrashford/osascript-audio/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: damionrashford (https://skillmd.com/u/damionrashford)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/damionrashford/osascript-audio

---


# 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):
```bash
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:
```bash
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`:
```bash
uv run scripts/audio-devices.py
```

## Key AppleScript Patterns

```applescript
-- 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
```

