Skip to content

Add macOS AppleScript control - #184

Merged
teancom merged 3 commits into
mainfrom
claude/blissful-fermat-htpyrt
Sep 16, 2026
Merged

teancom merged 3 commits into
mainfrom
claude/blissful-fermat-htpyrt

Conversation

@balloob

@balloob balloob commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Make the app scriptable on macOS. It answers transport verbs (play, pause, playpause, next track, previous track, stop) that route through the existing player-command path, plus a read-only player state property (playing/paused/stopped) served from the cached now-playing state. Terminology matches Spotify's dictionary.

tell application "Music Assistant" to pause
tell application "Music Assistant" to player state

Not build-tested: the native code compiles only on macOS, unavailable in the authoring environment. Needs a local macOS build and a check in Script Editor before merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NkAGGZhXtBGdvkBqmt3bD3


Generated by Claude Code

Make the app answer Apple Events such as
`tell application "Music Assistant" to pause`.

A bundled scripting definition (MusicAssistant.sdef) declares the
transport verbs (play, pause, playpause, next track, previous track,
stop). Info.plist enables scripting and points at it. A new macOS
module installs the matching Apple Event handlers, which route to the
same player-command callback the OS media controls already use.

Being a scripting target needs no extra sandbox entitlement.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkAGGZhXtBGdvkBqmt3bD3
Answer `tell application "Music Assistant" to player state` with
playing, paused, or stopped, matching Spotify's terminology.

The read-only property is served from the cached now-playing state
via a Core suite get-data handler, so no round-trip to the web UI is
needed. The sdef gains the application class, the EPlS enumeration,
and the player state property.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkAGGZhXtBGdvkBqmt3bD3
`AEGetKeyPtr` is a C macro aliased to `AEGetParamPtr`, not an exported
symbol, so declaring it as an extern function left `_AEGetKeyPtr`
undefined at link time. Call `AEGetParamPtr` instead; an AERecord is an
AppleEvent, so it reads the keyword identically.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkAGGZhXtBGdvkBqmt3bD3
@balloob
balloob marked this pull request as ready for review September 15, 2026 01:23
@teancom
teancom merged commit 3e4ccc0 into main Sep 16, 2026
16 checks passed
@teancom
teancom deleted the claude/blissful-fermat-htpyrt branch September 16, 2026 22:58
@teancom

teancom commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants