I'd like to read a hex PersistentID string from ItunesMusicLibrary.xml, get two ints representing the high and low 32 bits, then use those two ints in an iTunes script.
Unfortunately, the Persistent ID string in ItunesMusicLibrary.xml does not seem to be the same Persistent ID that's in itunes, as accessible through various scripting interfaces
itunes music library.xml includes a 64 bit key, Persistent ID. For example,
<key>Persistent ID</key><string>0F1610959DA92DAB</string>.
You can also get the PersistentID through a script using the windows COM interface. For example,
iTunes.ITObjectPersistentIDHigh(track) -> 253104277
iTunes.ITObjectPersistentIDLow(track) -> -1649857109
If I feed those two numbers back into iTunes, I get the correct track
iTunes.LibraryPlaylist.Tracks.ItemByPersistentID(253104277,-1649857109).Name
My problem is translating the hex string from the xml library to high and low integers
For example, in python
int('0F1610959DA92DAB'[:8], 16) -> 253104277
int('0F1610959DA92DAB'[8:], 16) -> 2645110187
The first is correct, the second is not. If I feed the two values back into iTunes, it doesn't work. Using other tracks, sometimes both numbers are wrong.
Any idea what's going on and how to fix it?