SKILL.md--- name: spotify-applescript description: Control Spotify desktop app via AppleScript. Play playlists, tracks, albums, episodes, and manage playback. Works reliably with macOS Spotify app without API keys or OAuth. homepage: https://github.com/andrewjiang/HoloClawd-Open-Firmware metadata: {"clawdbot":{"emoji":"🎵","os":["darwin"]}} triggers: - spotify - play music - play playlist - play episode - pause music - next track - previous track --- # 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 ```bash # Play a playlist spotify play "spotify:playlist:665eC1myDA8iSepZ0HOZdG" spotify play "https://open.spotify.com/playlist/665eC1myDA8iSepZ0HOZdG" # Play an episode spotify play "spotify:episode:5yJKH11UlF3sS3gcKKaUYx" spotify play "https://open.spotify.com/episode/5yJKH11UlF3sS3gcKKaUYx" # 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 | Command | Description | Example | |---------|-------------|---------| | `play <uri>` | Play track/album/playlist/episode | `spotify play spotify:track:xxx` | | `pause` | Toggle play/pause | `spotify pause` | | `next` | Next track | `spotify next` | | `prev` | Previous track | `spotify prev` | | `status` | Show current track info | `spotify status` | | `volume <0-100>` | Set volume | `spotify volume 75` | | `mute` | Mute | `spotify mute` | | `unmute` | Unmute | `spotify unmute` | ### URI Formats Accepts both Spotify URIs and open.spotify.com URLs: - `spotify:track:7hQJA50XrCWABAu5v6QZ4i` - `https://open.spotify.com/track/7hQJA50XrCWABAu5v6QZ4i` - `spotify:playlist:665eC1myDA8iSepZ0HOZdG` - `https://open.spotify.com/playlist/665eC1myDA8iSepZ0HOZdG?si=xxx` - `spotify:episode:5yJKH11UlF3sS3gcKKaUYx` - `https://open.spotify.com/episode/5yJKH11UlF3sS3gcKKaUYx` - `spotify:album:xxx` - `spotify:artist:xxx` The script auto-converts URLs to URIs. ## Direct AppleScript Commands For more control, use AppleScript directly: ```bash # Play osascript -e 'tell application "Spotify" to play track "spotify:playlist:xxx"' # Pause/Play toggle osascript -e 'tell application "Spotify" to playpause' # Next/Previous osascript -e 'tell application "Spotify" to next track' osascript -e 'tell application "Spotify" to previous track' # Get current track osascript -e 'tell application "Spotify" set trackName to name of current track set artistName to artist of curren