[Pythonmac-SIG] appscript: selecting many songs in iTunes
niko at alum.mit.edu
Tue Jan 17 15:17:29 CET 2006
>> If this *is* just a limitation in iTunes, I have to admit I'm a
>> bit of a loss as to how to proceed.
> Did you try the alternative script I suggested? How did that fare?
Well, your alternative doesn't quite do what I want. The duplicates
don't actually have the same database_ID: instead, there are two
songs that have the same artist/album/tracknumber, or other
conditions. I did, however, come up with another possibility along
the same lines; I've implemented it, but I haven't been able to test
it for speed against the whole library.
What I've ended up with is something that's actually somewhat
similar: I extract from each set of duplicates the artist name, and
then select all songs with that artist, and their database ID. I
then delete the track if the database ID is in the list of IDs to kill.
But now, closer to your original suggestion, I am thinking of just
selecting the song handle and database ID of EVERY track, once, and
then iterating through. After all, when I start up I load a lot of
information about every track (artist, album, etc) this way and it's
not *that* slow.
Well, I'll benchmark the two approaches against my full library and
report back on the results :). The question is whether having more
AppleEvents will be slower than selecting way too much data.
thanks for your help,
More information about the Pythonmac-SIG