Fixing Windows Media Playlist order
The playlist ordering problem is particularly annoying for tracks ripped from a CD whose name starts with the track number and which end up in reverse order on the Pocket PC. Here is a solution which will work if you happen to have Mathematica. It is based on noticing that playlists are simple XML files and uses Mathematica's built in functions for handling that. It sorts on the track filenames but other sorting methods could be implemented similarly. The same could surely be done with other tools.
You have to create the playlist on the PDA, copy it to your PC, apply the following function to create a new version and then copy it back to the PDA.
SortPlaylist::usage = "SortPlaylist[asxfile1,asxfile2] sorts the Windows \
Media playlist in file asxfile1 and saves it as asxfile2."
SortPlaylist[pl1_String, pl2_String] := Module[{},
Export[pl2, Import[pl1,
"XML"] /. {a__, entries :
XMLElement["ENTRY", {}, {XMLElement["ref", {_}, {}]}] ..} :> {
a, Sequence @@ Sort[{entries}]},
"XML", ConversionOptions -> {"AttributeQuoting" -> "\""}]
]
Hope this helps somebody. It was fun as a programming exercise.
|