Update iTunes Smart Playlists with Limits
I use Smart Playlists to load my iPhone. One of my smart playlists is songs that are rated 4 or 5 stars. Currently that amounts to 337 songs and 2.5GB. I don’t want to put 2.GB of music onto my iPhone (I do need room for photos, apps, movies, and audiobooks!). To limit the number of songs, I set the playlist to limit the number of songs to 100 (still a lot of music – 6 1/2 hours!).
When you set the limit to a certain number of songs (or size) you can choose how iTunes picks your songs. I chose ‘Randomly’. Once you do this, iTunes will keep that list of songs the same even if you rate new songs. This is not what I wanted.
The solution? Why, Google and AppleScript of course.
I Googled “itunes smart playlist randomly update” and eventually came across bbum’s blog at http://radio.weblogs.com/0100490/2002/12/09.html. He discovered that you can get iTunes to refresh the list of songs by selecting them and hitting delete. I figured that if you can do it manually then you should be able to script it.
This quick AppleScript will refresh the smart playlist named “Random Best 100″. Naturally, you can change the name to match your particular playlist.
tell application "iTunes" set thePL to playlist "Random Best 100" delete every track of thePL end tell
Now to schedule it through iCal and I’m good to go.
Technorati Tags: AppleScript, iTunes
