Applescript:

Extra context:My source playlist has 20,000 tracks, that sit on a separate "server" machine. All are indexed though.

Using iTunes' UI, if I select them all then right click > "add to playlist [...]" then that too takes ages. However, if I select the tracks then go to "File">"New">"Playlist from Selection", that's instantaneous. And why wouldn't it? I'm not asking iTunes to duplicate the actual files, just the track references.

And btw, I've simplified the code to go to the essence of the issue, but my actual objective is to not just copy all tracks, but only the ones that match a criterion.I.e this:

Applescript:

From my testing it is clear that it is not the "bpm" condition that slows everything down, it's the actual duplicate function.

Appreciate any help! This is the last problem I need to solve to bring to its conclusion a very cool project I've spent a couple of weeks on: generate playlists on the fly based on "mood" scores (happy, sad, danceable, bright timbre etc.), calculated in real time based on the inputs from a physical midi controller.

Re: Fast script to duplicate an iTunes playlist?

Hi Doug. I tried just now to run the same line of code mentioned above, from iTunes and from the script editor, and it takes the same time (around 26 secs) to find and "duplicate" 4000 tracks. :'(

Would you know of another approach worth trying? I'm open to a mac gyver-style solution, as long as it results in a playlist that's been filtered based on the bpm value. And it needs to be AppleScript, because I am using MidiPipe to trigger parts of the script's code based on Midi control events.