Repository navigation
Add macOS AppleScript control - #184
Merged
Merged
Conversation
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
Contributor
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 stateproperty (playing/paused/stopped) served from the cached now-playing state. Terminology matches Spotify's dictionary.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