Music Actions

Table of contents

  1. Add to Music
  2. Get Current Song
  3. Get Music Detail
  4. Play Music
  5. Select Music
  6. Playback
    1. Clear Up Next
    2. Pause
    3. Play
    4. Play Next
    5. Play Next
    6. Seek
    7. Skip Back
    8. Skip Forward
    9. Toggle Play/Pause
  7. Playlists
    1. Add to Playlist
    2. Get Playlist

To use actions in this category, use this include statement:

#include 'actions/music'

Add to Music

Add music to library.

addToMusic(variable songs)

Get Current Song

Gets the currently playing song.

getCurrentSong()

Get Music Detail

Get a detail about a song.

enum musicDetail {
    'Title',
    'Album',
    'Artist',
    'Album Artist',
    'Genre',
    'Composer',
    'Date Added',
    'Media Kind',
    'Duration',
    'Play Count',
    'Track Number',
    'Disc Number',
    'Album Artwork',
    'Is Explicit',
    'Lyrics',
    'Release Date',
    'Comments',
    'Is Cloud Item',
    'Skip Count',
    'Last Played Date',
    'Rating',
    'File Path',
    'Name',
}

getMusicDetail(variable music, musicDetail detail)

Play Music

Set music to play with modes for shuffle and repeat.

enum shuffleMode {
    'Off',
    'Songs',
}

enum repeatMode {
    'None',
    'One',
    'All',
}

playMusic(variable music, shuffleMode ?shuffle, repeatMode ?repeat)

Select Music

Prompt the user to select music.

selectMusic(bool ?selectMultiple = false)

Playback

Clear Up Next

Clear the queue.

clearUpNext()

Pause

Press pause.

pause()

Play

Press play.

play()

Play Next

Add music to play next in the queue.

playNext(variable music)

Play Next

Add music to the end of the queue.

playLater(variable music)

Seek

Seek the currently playing media.

enum timerDuration {
    'hr',
    'min',
    'sec',
}

enum seekBehavior {
    'To Time',
    'Forward By',
    'Backward By',
}

seek(number magnitude, timerDuration duration, seekBehavior ?behavior = "To Time")

Skip Back

Go to the previous song.

skipBack()

Skip Forward

Go to the next song.

skipFwd()

Toggle Play/Pause

togglePlayPause()

Playlists

Add to Playlist

addToPlaylist(text playlistName, variable songs)

Get Playlist

Gets songs from a playlist

getPlaylistSongs(variable playlistName): array

Copyright ©. Distributed under the GPL-2.0 License. Siri Shortcuts and Mac are registered trademarks of Apple Inc. Apple is not involved in this project in any way. Do not contact Apple Support unless you are having an issue with the Shortcuts app itself.