Apple Music Playback
Control Apple Music directly from Raycast.apple-music-current-track.applescript - Display Now Playing
apple-music-current-track.applescript - Display Now Playing
Show the currently playing track in your Raycast menu bar with auto-refresh.How it works:
- Checks if Music app is running before attempting to query it
- Uses AppleScript’s
tell applicationto communicate with Music - Gets current track name, artist, and player state
- Updates every 10 seconds when displayed in menu bar
- Shows playback state (Playing/Paused) for context
apple-music-volume-up.applescript - Increase Volume
apple-music-volume-up.applescript - Increase Volume
Quickly increase Apple Music volume by 5%.How it works:
- Adjusts Music app’s internal volume (separate from system volume)
- Increases by 5 points per execution
- Runs in silent mode with just an arrow indicator
- Uses
tryblock to handle cases where Music isn’t running - Can be triggered repeatedly for fine-grained control
+ 5 to - 5 and the arrow to ⬇.Spotify Integration
spotify-current-track.applescript - Show Playing Track
spotify-current-track.applescript - Show Playing Track
Display what’s currently playing on Spotify.How it works:
- Similar to Apple Music script but targets Spotify
- Refreshes every 30 seconds
- Handles cases where Spotify is not running
- Displays track and artist with “by” separator
- Perfect for menu bar display
Universal Media Scripts
These patterns work across multiple media players.Creating Play/Pause Controls
Creating Play/Pause Controls
Create universal play/pause controls for any media app.How it works:
- Uses the universal
playpausecommand available in most media apps - Toggles between play and pause states
- Works even when the app is in the background
- Silent mode for instant execution without UI
Next/Previous Track Controls
Next/Previous Track Controls
Skip tracks forward or backward.How it works:
next trackandprevious trackare standard AppleScript commands- Work with Apple Music, Spotify, and most media players
- Execute instantly in silent mode
- Can be bound to keyboard shortcuts for quick access
Volume Management
Fine-Grained Volume Control
Fine-Grained Volume Control
Create custom volume adjustments for precise control.How it works:
- Takes volume level as argument (0-100)
- Validates input is within acceptable range
- Sets Music app volume directly
- Provides notification feedback
- More precise than increment/decrement buttons
Advanced Media Controls
Love/Hate Current Track
Love/Hate Current Track
Rate tracks directly from Raycast.How it works:
- Checks if a track is currently playing
- Sets the
lovedproperty of the current track - Shows notification with track name
- Integrates with Apple Music’s recommendation algorithm
- Can create similar script for “hate” by setting
lovedtofalse
System Audio Controls
Toggle System Mute
Toggle System Mute
Quickly mute/unmute system audio.How it works:
- Gets current system volume and mute state
- Toggles mute while preserving volume level
- Provides clear feedback via notifications
- Works system-wide, affecting all applications
Media Script Patterns
Inline vs Silent Mode: Use
inline mode for status displays (now playing) and silent mode for actions (play/pause, next track). This gives users appropriate feedback without interrupting their workflow.Testing Media Scripts
- Use Script Editor: Open Script Editor (in /Applications/Utilities) to test AppleScript commands interactively
- Check App Dictionary: In Script Editor, go to File > Open Dictionary to see available commands for each app
- Handle Edge Cases: Always check if the app is running and if media is playing before executing commands
See Also
System Scripts
Battery, network, and system monitoring
Developer Utils
Git, Docker, and encoding utilities
App Integrations
Control Bear, Spotify, Safari, and more
Productivity
Todo lists, timers, and password managers

