Media & StreamingDocumentedScanned

spotify-applescript

Control Spotify desktop app via AppleScript.

Share:

Installation

npx clawhub@latest install spotify-applescript

View the full skill documentation and source below.

Documentation

Spotify AppleScript Control

Control the Spotify desktop app using AppleScript. Works reliably with the macOS Spotify app without API rate limits or OAuth.

Requirements

  • Spotify desktop app installed and running on macOS
  • No setup required - just works

Quick Start

# Play a playlist
spotify play "spotify:playlist:665eC1myDA8iSepZ0HOZdG"
spotify play ""

# Play an episode
spotify play "spotify:episode:5yJKH11UlF3sS3gcKKaUYx"
spotify play ""

# Play a track
spotify play "spotify:track:7hQJA50XrCWABAu5v6QZ4i"

# Playback control
spotify pause          # Toggle play/pause
spotify next           # Next track
spotify prev           # Previous track
spotify status         # Current track info

# Volume control
spotify volume 50      # Set volume (0-100)
spotify mute           # Mute
spotify unmute         # Unmute

Spotify CLI Wrapper

The spotify command is a wrapper script at {baseDir}/spotify.sh

Commands

CommandDescriptionExample
play Play track/album/playlist/episodespotify play spotify:track:xxx
pauseToggle play/pausespotify pause
nextNext trackspotify next
prevPrevious trackspotify prev
statusShow current track infospotify status
volume <0-100>Set volumespotify volume 75
muteMutespotify mute
unmuteUnmutespotify unmute

URI Formats

Accepts both Spotify URIs and open.spotify.com URLs:

  • spotify:track:7hQJA50XrCWABAu5v6QZ4i
  • - spotify:playlist:665eC1myDA8iSepZ0HOZdG -
  • spotify:episode:5yJKH11UlF3sS3gcKKaUYx
  • - spotify:album:xxx - spotify:artist:xxx The script auto-converts URLs to URIs. ## Direct AppleScript Commands For more control, use AppleScript directly: __CODE_BLOCK_1__ ## Available Properties __CODE_BLOCK_2__ ## Examples ### Agent Usage When the user says: - "Play my power hour playlist" → extract playlist URI and run spotify play - "Pause the music" → run spotify pause - "Next track" → run spotify next - "What's playing?" → run spotify status ### Play a specific episode __CODE_BLOCK_3__ ### Get full track info __CODE_BLOCK_4__ ## Installation The skill is self-contained. To make the spotify command available system-wide: __CODE_BLOCK_5__ Or add the skill directory to PATH. ## Troubleshooting **"Spotify got an error"** - Make sure Spotify desktop app is running - Spotify must be launched at least once to accept AppleScript commands **Play command does nothing** - Verify the URI format is correct - Try playing from Spotify app first to ensure the content exists **No audio** - Check system volume and Spotify app volume - Ensure correct output device is selected in Spotify preferences ## Limitations - Requires Spotify desktop app to be running - macOS only (uses AppleScript) - Cannot search or browse library (use web interface or app for discovery) - Cannot manage playlists (add/remove tracks) For playlist management and search, use the web interface or consider the spotify-player` skill (requires OAuth setup).