Created
August 2, 2011 02:29
-
-
Save talios/1119473 to your computer and use it in GitHub Desktop.
F-Script based iTunes playlist sort hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| df := NSDateFormatter new. | |
| df setDateFormat: 'yyyy-MM'. | |
| iTunes := SBApplication applicationWithBundleIdentifier:'com.apple.iTunes'. | |
| playlists := (iTunes sources at: 0) playlists. | |
| playlist := (playlists where: playlists name = 'The Full Daily Play') top. | |
| playlist tracks do: [:track | | |
| skipDate := (NSDate dateWithString: (df stringFromDate: track dateAdded) ++ '-01 00:00:00 +1200'). | |
| group := (df stringFromDate: track skippedDate). | |
| (skipDate isEqualToDate: track skippedDate) ifFalse: [ track setSkippedDate: skipDate]. | |
| (group isEqualToString: track grouping) ifFalse: [ track setGrouping: group]. | |
| ]. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment