Get the FREE Ultimate OpenClaw Setup Guide →

apple-music-player

npx machina-cli add skill IvanCampos/agents/apple-music-player --openclaw
Files (1)
SKILL.md
1.6 KB

Apple Music Player

Overview

Play a random track from the Music app's local library by artist, album, or playlist, using a bundled script that wraps AppleScript and handles errors.

Quick Start

  • Artist: scripts/play_random_music.sh --artist "JAY-Z"
  • Album: scripts/play_random_music.sh --album "TRON: Ares"
  • Playlist: scripts/play_random_music.sh --playlist "My Favorites"
  • Track: scripts/play_random_music.sh --track "Rock the Boat" --artist "XG"
  • Foreground (optional): append --foreground to bring Music to front.

Behavior Notes

  • Operates on the local Music library only; it does not search Apple Music.
  • Artist, album, and track matching use "contains" so partial names work.
  • Playlist matching requires an exact playlist name.
  • Performance path keeps Music in background by default; use --foreground only when needed.

Workflow

  1. Prefer using the script in scripts/ rather than retyping AppleScript.
  2. If no matches are found, surface the script's error message to the user.
  3. If the user needs Apple Music search/playback, ask them to add the album or track to the Library first.

Resources

scripts/

  • scripts/play_random_music.sh: performance-optimized AppleScript runner to play by artist/album/playlist/track with optional foreground activation.

Source

git clone https://github.com/IvanCampos/agents/blob/main/skills/apple-music-player/SKILL.mdView on GitHub

Overview

Apple Music Player uses a bundled script wrapping AppleScript to play a random track from the local Music app library by artist, album, or playlist, or to play a specific track by name (optionally with artist). It operates strictly on the local library and does not query Apple Music. This makes playback fast and predictable for offline use.

How This Skill Works

The skill runs scripts/play_random_music.sh with flags such as --artist, --album, --playlist, or --track. Matching uses contains for artists, albums, and tracks, so partial names work; playlists require an exact name. Playback is kept in the background by default, with --foreground available to bring Music to the front; if no matches are found, it surfaces the script's error.

When to Use It

  • User asks for a random track by a specific artist from the local library.
  • User asks for a random track from a particular album.
  • User asks for a random track from a named playlist.
  • User asks to play a specific track by name, optionally with artist.
  • User wants to keep Music playing in the background or bring it to the foreground for immediate control.

Quick Start

  1. Step 1: Choose a mode and run scripts/play_random_music.sh with --artist, --album, --playlist, or --track.
  2. Step 2: Optionally append --foreground to bring Music to the front.
  3. Step 3: If no matches are found, review the script output and adjust the query or verify the item exists in the library.

Best Practices

  • Use the provided script path scripts/play_random_music.sh instead of retyping AppleScript.
  • Leverage contains matching for artist, album, and track to accommodate partial names.
  • Remember that playlist matching requires an exact playlist name.
  • Default playback runs in the background; use --foreground only when you need the Music window.
  • Surface the script errors to guide users if no matches are found or items are missing from the library.

Example Use Cases

  • Play a random track by artist JAY-Z: scripts/play_random_music.sh --artist 'JAY-Z'
  • Play a random track from album 'TRON: Ares': scripts/play_random_music.sh --album 'TRON: Ares'
  • Play a random track from playlist 'My Favorites': scripts/play_random_music.sh --playlist 'My Favorites'
  • Play specific track 'Rock the Boat' by XG: scripts/play_random_music.sh --track 'Rock the Boat' --artist 'XG'
  • Bring Music to the front before playback: append --foreground to any command

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers