Apple Music

Action music.note

action.apple_music

Control Apple Music playback from your workflows. Search your library and play songs, albums, playlists, or artists. You can also send basic playback commands: play, pause, next track, and previous track. Shuffle and start position are configurable.

Uses AppleScript to communicate with the Music app. Requires Apple Music to be installed and running.

Searches your library, not the full Apple Music catalog

Search & Play only finds music that’s already in your library — anything you’ve added with the + Add button in the Music app, plus playlists you’ve created or saved. It cannot search the streaming catalog at large: a search for an artist or song you’ve never added (e.g. Sublime) will fail with “No … found.”

To make something findable, open it in the Music app and click + Add first — it will then appear under Library (Songs, Albums, Artists, or Playlists) and the node can play it. Adding to your library does not require downloading; streamed-but-added items work fine. This is a limitation of macOS AppleScript, which can only reach your library.

Ports

DirectionNameData TypeDescription
InputInputAnyIncoming payload
OutputOutputAnyPayload with playback metadata

Configuration

FieldTypeDefaultDescription
actionDropdownsearch_playAction: Search & Play, Play, Pause, Next Track, Previous Track
searchQueryTextSearch query. Supports {{var}}. Visible when action = search_play.
searchTypeDropdownsongSearch type: Song, Album, Playlist, or Artist. Visible when action = search_play.
shuffleBooleanfalseEnable shuffle playback
startAtTextStart position (e.g., 1:35 or 0:00)

Output Variables

VariableTypeDescription
trackNameStringName of the current track
artistNameStringArtist of the current track
albumNameStringAlbum of the current track
playingBooleanWhether music is currently playing

Example

Toggle music playback with a keyboard shortcut: