Pull *Albums* by "least recently played"

Like so many this year, I got an iPod (Nano) for Christmas! And like other folks whose music collection is much larger than their iPod, I need a way to “cycle” my tunes through the Nano so that I’m not in a musical rut.

I love smart playlists’ ability to choose songs by “least recently played,” but I’m an old geezer who still likes listening to an entire album (Pink Floyd’s “Dark Side of the Moon” just doesn’t work all chopped up, ya know?). Unfortunately, there’s no way (that I’m aware of) to grab an entire album into a playlist just based on “least recently played.”

My (current) solution is to define a “core albums” regular playlist that I’m updating using an applescript. This script wipes the entire album playlist and rebuilds it from random choices:

set kb to 1024
set mb to 1000 * kb
set gb to 1000 * mb
set NanoThreshold to 1.5 * gb

--get album list from iTunes
set prohibitedGenres to {"video", "TV Shows", "Podcast", "Holiday", "Christmas"}
set allAlbumsList to {}
set shortAlbumList to {}
tell application "iTunes" to tell (get album of file tracks of library playlist 1) to set {albumList, tcount} to {it, count it}
repeat with i from 1 to tcount
	tell my albumList's item i to if it is not in my allAlbumsList and it ≠ "" then set end of my allAlbumsList to it
end repeat

--set up playlist and play
tell application "iTunes"
	if exists user playlist "Core Albums" then
		delete every file track of user playlist "Core Albums"
	else
		make new user playlist with properties {name:"Core Albums"}
	end if
	repeat while size of user playlist "Core Albums" < NanoThreshold
		set theAlbum to some item of allAlbumsList
		if shortAlbumList does not contain theAlbum then
			set testTrack to first file track of library playlist 1 whose album is theAlbum
			if genre of testTrack is not in prohibitedGenres then
				duplicate (every file track of library playlist 1 whose (podcast is false) and (album is theAlbum)) to user playlist "Core Albums"
				set shortAlbumList to shortAlbumList & theAlbum
			end if
		end if
	end repeat
end tell

My other smart playlists then pull from this “master” list to fill categories like “mellow mix,” “instrumentals,” etc. based on comments I’ve put in each track.

This works fairly well, but I’m still wishing for a way to look at the “played date” of each track of an album and make some kind of decision about what date to use (least recent, most recent, or average) and use that date to “schedule” the album’s appearance in the master playlist.

Any ideas? Is anyone doing something similar? I’d love to hear how other folks are handling this on their 'pods.