(* Now and then I like to look back and see which albums I've neglected playing for a while, and listen to them as whole albums. However, as sometimes I like to shuffle by song, it takes a bit of looking to decide which albums haven't been played in a while, and to create a playlist of the whole albums (rather than just the least recently played songs of those albums). So I wrote this AppleScript to tell me how long it has been since the least recently played song was played, lets me enter how many days back to look, and then finds those albums containing at least one song which hasn't been played in that period of time. This variation of that AppleScript only lists those albums for which half or less of those songs have been played in that period of time (the ratio of 'half' can be easily changed in the script). The scripts require that you first create a smart playlist called AllMusic of the music files of your library (leaving out all those digital booklets and videos). (DA Notes: This is not necessary; the script will check all tracks in your master Music playlist.) After that, the scripts are fairly robust, although they probably could be prettier. They create playlists named Dustiest Albums and Dustier Albums, respectively. I hope you find them useful. *) tell application "iTunes" set lastTimes to {} set longestTime to 0 -- set lastTimes to the (played date of every track of playlist "AllMusic") -- da:removed, replaced with the following: set musicLibrary to (some playlist whose special kind is Music) set lastTimes to the (played date of every track of musicLibrary) set curDate to (get current date) repeat with i in lastTimes try -- da: added try in case a song has no played date set tempVariable to curDate - i if tempVariable is greater than longestTime then set longestTime to tempVariable end if end try -- da end repeat set daysAgo to (longestTime div 86400) set overDay to (longestTime / 86400) - daysAgo set decimalHours to (overDay * 24) set andHours to overDay div (1 / 24) set overHours to (overDay * 24) - andHours set andMinutes to overHours div (1 / 60) if daysAgo is 1 then set daysWord to " day" else set daysWord to " days" end if if andHours is 1 then set hoursWord to " hour" else set hoursWord to " hours" end if if andMinutes is 1 then set minutesWord to " minute" else set minutesWord to " minutes" end if display dialog "The oldest song was last played " & daysAgo & daysWord & " and " & andHours & hoursWord & " and " & andMinutes & minutesWord & " ago." set daysSincePlayed to "" set {daysSincePlayed, the button_pressed} to {text returned, button returned} of (display dialog "Enter the number of days since last played:" default answer the daysSincePlayed) set targetDate to curDate - daysSincePlayed * days set cobwebbedLibrary to the tracks of musicLibrary as list if user playlist "Dustier Albums" exists then -- da: added option to add or replace if button returned of (display dialog "\"Dustier Albums\" playlist already exists. Add new albums to it or Replace current albums in it?" buttons {"Add", "Replace"}) is "replace" then try delete tracks of user playlist "Dustier Albums" end try end if else make new user playlist with properties {name:"Dustier Albums", shuffle:false, song repeat:none} end if set dustiestSong to "" set dustiestAlbum to "" set dupedAlbums to {} as list if the (count of tracks of user playlist "Dustier Albums") is 0 then set alreadylistedDusty to {} else set alreadylistedDusty to the name of every track of user playlist "Dustier Albums" end if repeat with i from 1 to the count of cobwebbedLibrary set dustiestSong to item i of cobwebbedLibrary set playedDate to played date of dustiestSong if playedDate is less than targetDate then if (album of dustiestSong is not in dupedAlbums) and (name of dustiestSong is not in alreadylistedDusty) then set dustiestAlbum to album of dustiestSong set oldCount to 0 set albumSize to 0 set songNames to (every track of library playlist 1 whose album is dustiestAlbum) repeat with eachSong in songNames try -- da: added try in case no songs have played date set playedDate to the played date of eachSong if playedDate is less than or equal to targetDate then set oldCount to oldCount + 1 end if set albumSize to albumSize + 1 end try end repeat if ((2 * oldCount) div albumSize) is greater than or equal to 1 then set dupedAlbums to dupedAlbums & dustiestAlbum duplicate (every track of library playlist 1 whose album is dustiestAlbum) to user playlist "Dustier Albums" end if end if end if end repeat display dialog "Transfer Complete" end tell