1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How Persistent are IDs?

Discussion in 'iTunes & AppleScripts' started by UKenGB, Dec 14, 2015.

  1. UKenGB

    UKenGB Member

    That's it really. Apple use a 'persistent' ID for iTune's library, playlists and tracks. At least, in the XML file, but I don't see them listed in the AppleScript dictionary. So:-
    • Are these persistent IDs available to use in AppleScript?
    • What does 'persistent' mean?
    Obviously I understand what the term 'persistent' means, but in the context of iTunes IDs, just how persistent are they and why have those AND other 'normal' IDs for playlists and tracks. Looking in the Album Artwork folder, I can see numerous persistent library IDs being used, but if it is truly persistent, there really should only be the one, for the library iTunes has always used.

    When might regular IDs get changed? I know iTunes updates sometimes require a library rebuild. Does that mean they are changing all the normal IDs?

    I'm looking into creating my own music database and would like a way to link between the 2. Persistent IDs would seem sensible, but iTunes playlists only seem to use regular IDs to link to the tracks. Why would they do that?

    Anyone shed any light on this?
  2. DougAdams

    DougAdams Moderator Staff Member

    The persistent ID property is inherited from item. They are persistent for as long as the track entry is in the library, unlike the database ID which can change under various circumstances. It is probably safe to use persistent ID in an external database.
    Last edited: Dec 14, 2015
  3. UKenGB

    UKenGB Member

    Thanks for that Doug. Now I can see where to find them.

    There were problems reported some years ago of AppleScript not being able to fully handle the 64bit IDs. Has that gone away now with later AS implementations?

    What about playlists? They only link to the normal ID. Seems to me I'd need both ID in each track then. Or, could I export a playlist that referenced the Persistent IDs of the tracks? Well, anything's possible, but does that sound realistic?
  4. DougAdams

    DougAdams Moderator Staff Member

Share This Page