maca_lescour_

Q: Automator Apple Music playlist

I am trying to write an automator action that will play an apple music playlist when hitting F4. This works for normal playlists and smart playlists I have created with my own music but doesn't seem to work with Apple Music playlists like the A-list playlists.

Any ideas why this is?

macbook

Posted on Jul 29, 2016 4:10 AM

Close

Q: Automator Apple Music playlist

  • All replies
  • Helpful answers

  • by maca_lescour_,

    maca_lescour_ maca_lescour_ Aug 2, 2016 6:58 AM in response to maca_lescour_
    Level 1 (12 points)
    Apple Music
    Aug 2, 2016 6:58 AM in response to maca_lescour_

    I have figured it out for anyone else trying to do this -

     

     

    use application "iTunes"

     

    property playlistURL : "itmss://itunes.apple.com/gb/playlist/the-a-list-electronic/idpl.4705ab1ed97c4f 4bb54f48940faf5623"

    property playlistName : "The A-List: Electronic"

    tell application "iTunes" to stop

    set shuffle enabled to true

     

    set playlistToPlay to a reference to subscription playlist playlistName of source "iTunes Store"

    open location playlistURL

     

    set i to 0

    repeat while i < 30

      delay 1

      try

      tell playlistToPlay to if it exists then

      play it

      if player state is playing then return

      end if

      end try

      set i to i + 1

    end repeat

  • by Jarvissg,

    Jarvissg Jarvissg Sep 4, 2016 11:15 PM in response to maca_lescour_
    Level 1 (8 points)
    Sep 4, 2016 11:15 PM in response to maca_lescour_

    Another work-around:

     

    Duplicate the Apple Music Playlist and the playlist will end up in "My Music Playlist".

     

    This allows Automator to play the specific Music Playlist using "Play iTunes Playlist" function that it couldn't before.