These are projects posted by the students of Dr. Gove Allen at Brigham Young University. These students have taken one semester-long course on VBA and generally have had no prior programming experience

Friday, April 16, 2010

ITunes Playlist Comparer

Brandon Carroll
ISys 540

Download ITunesUtils.xlsm
Link to project write-up


For the past several years, I have wished that iTunes had the capability to compare (or perform a “diff” on) two playlists. There are many situations I have encountered where the ability to see which songs are common between two playlists and which songs are different would be useful. For instance, I have often wanted to verify that all the songs I wanted in a playlist actually got added to it. To do this, it would be a lot easier for me to scroll through a list of songs that are not in the playlist because I would notice the ones that were out of place. However, iTunes only lets you view the songs that are in the playlist, and it is a lot harder to notice songs that aren’t there but should be because nothing is out of place. This has become even more of a problem for me with the introduction of the newer iPod Touches and iPhones because their solid-state drives have smaller capacities than older iPods and are too small to hold my entire library. Thus, I have to pick and choose which songs get put on my iPod and would often like to see the list of songs that are not in the playlists that get synced to it as I make my decisions.


For my project, I used Excel and VBA to write a utility that allows the user to compare and edit playlists in iTunes. When the user selects playlists on the left and right sides, the worksheet sorts the songs from the playlists into three columns. The left and right columns contain the songs that are only in the left or right playlist, respectively. The middle column lists the songs that are in both playlists. The user can sort the three columns by any of the four fields displayed in the list. Furthermore, the user can select and move songs from one column to another, or remove them from the playlists entirely. The worksheet uses the COM interface exposed by iTunes to propagate these changes into the actual playlists in the iTunes library. The user interface is shown in the image below.


  1. Since posting this project, I noticed a somewhat annoying bug with the ActiveX ListBoxes. If you click a playlist that takes a long time to load and then move/hover your cursor over different entries in the listbox while it is still loading, the activeX ListBox will fire events for some of those entries as well before eventually returning to the original entry that you clicked. I have no idea how to fix or prevent this, and am open to suggestions.

  2. Using COM with iTunes is genius! No need to import/export... if I understand this correctly. Nice work.

  3. Brandon - This is an awesome tool for those of us with rather large and unruly iTunes libraries. I hope you're still checking this blog, and I also hope that by now you are working for a top notch company and being paid ridiculously well. You deserve it dude. BTW - Are you ?the same Brandon as CCIE#23837? Just curious.

    Thanks so much for a really cool tool.


  4. Well, it was a little buggy. I couldn't see the full name of my long-named playlist. On the right, it was randomly switching the selection when my mouse moved. But eventually, it worked, so thank you very much!

  5. Looks like the Excel file is no longer on the repository. Any idea how to find it?




Blog Archive