You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iTunes Shortcut

I have the following shortcut where EZ is the playlist consisting of 2 songs. I want it to keep repeating these 2 songs. It plays 2 songs and stops.

What am I missing? Thanks

iMac

Posted on Feb 14, 2023 11:29 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 17, 2023 1:38 PM

See Shuffle or repeat songs in Music on Mac - Apple Support. If you set Music up to Repeat All before you run the script, then once you tell it to play the playlist it should do so on repeat.


Alternatively you can add this bit of code before you play the playlist:


set song repeat to all


If you want to play the songs a specific number of times you'd need to add in some sort of event handler that knows when a new song has been started, updates a counter, and then tells Music to stop playing at a particular threshold. Or the trivial approach for a smaller number of repeats is to add the tracks to the playlist as many times as you want them played and set song repeat to off so the whole list plays just once.


tt2

5 replies
Question marked as Top-ranking reply

Feb 17, 2023 1:38 PM in response to mrokloricred37

See Shuffle or repeat songs in Music on Mac - Apple Support. If you set Music up to Repeat All before you run the script, then once you tell it to play the playlist it should do so on repeat.


Alternatively you can add this bit of code before you play the playlist:


set song repeat to all


If you want to play the songs a specific number of times you'd need to add in some sort of event handler that knows when a new song has been started, updates a counter, and then tells Music to stop playing at a particular threshold. Or the trivial approach for a smaller number of repeats is to add the tracks to the playlist as many times as you want them played and set song repeat to off so the whole list plays just once.


tt2

Feb 15, 2023 11:10 AM in response to mrokloricred37

I got this far which works. plays 2 songs and stops , but can't figure how to repeat. Put this into Shortcuts, but want it to play repeatedly till I turn it off. Also would like to know how to make it repeat 50 or 100 times


Thanks again


on run {input, parameters}

tell application "Music"

play playlist "ez"

end tell

return input

end run




iTunes Shortcut

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.