AppleScript Bug or Feature in iTunes 7.7.1
I think I have found a rather unusual AppleScript bug (or perhaps feature; one never knows) in iTunes 7.7.1. It affects several scripts that may need to reference a track using a persistent ID. When attempting to reference a single track with a whose clause, the track reference is returned coerced as a list. This requires that an additional step be taken to extricate the single item (the track reference) from the list. I have filed a bug report. It is reproducible with this script:
tell application "iTunes" set t to item 1 of selection set p to (get persistent ID of t) log ("p: " & p) set the_track to (some track of library playlist 1 whose persistent ID is p) -- the result is a list (* {file track id 33083 of library playlist id 10591 of source id 46} *) log the_track end tell