# 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

Direction | Name | Data Type | Description
--- | --- | --- | ---
Input | Input | Any | Incoming payload
Output | Output | Any | Payload with playback metadata

## Configuration

Field | Type | Default | Description
--- | --- | --- | ---
action | Dropdown | `search_play` | Action: Search & Play, Play, Pause, Next Track, Previous Track
searchQuery | Text | — | Search query. Supports `{{var}}`. Visible when action = search_play.
searchType | Dropdown | `song` | Search type: Song, Album, Playlist, or Artist. Visible when action = search_play.
shuffle | Boolean | `false` | Enable shuffle playback
startAt | Text | — | Start position (e.g., `1:35` or `0:00`)

## Output Variables

Variable | Type | Description
--- | --- | ---
trackName | String | Name of the current track
artistName | String | Artist of the current track
albumName | String | Album of the current track
playing | Boolean | Whether music is currently playing

## Example

Toggle music playback with a keyboard shortcut: