You Own It

July 10th, 2006

One of the rumors buzzing around the internet this past week is that Microsoft is working on a tough competitor to the iPod. Oooh! Shiver me timbers! The chances of Microsoft taking Apple down in the portable music arena are so miniscule that even John C. Dvorak thinks it’s impossible.

I heard him say so on today’s episode of This Week in Tech, one of the very best (and most popular) podcasts available. Another purported impossibility had to do with associated rumors that Microsoft was planning some kind of “buyback” plan for iTunes customers. The idea is that as a lure to switch to their service, Microsoft will offer to give you for free Windows Media versions of some number of songs from your existing iTunes library. The consensus seemed to be skepticism that Microsoft could even figure out which songs were the ones you had bought.

What immediately came to mind for me was the AppleScript interface to iTunes which, while pretty weak in some regards, still exposes quite a bit of information about the users’s music library. I was surprised the idea didn’t occur to host Leo Laporte, because I’ve heard him express a fairly high level of knowledge about AppleScript in the past. As a proof of concept, I’ve put together a simple script application. You Own It presents a list of all the purchased music from your library. If you’re at all concerned, or just curious, about what it does, just open it with Script Editor and read the script code yourself.

The crux of this functionality is based on a single iTunes AppleScript request

every track of library playlist 1 whose kind is “Protected AAC audio file”

I’m sure there are some loose ends here, but if Microsoft really wants to do this, it won’t be hard for them to do it right, or at least 95% right. Anyway, if they’re going to be giving out free songs, chances are they don’t really care if the songs are actually ones you bought from iTunes, or not.

22 Responses to “You Own It”

  1. adam Says:

    perhaps a stupid question but, does applescript work on windows?

  2. Daniel Jalkut Says:

    Hi Adam – I think it’s a pretty darned good question, considering the fact that Apple took the time to port iTunes over. But to the best of my knowledge, they haven’t done anything to support AppleScript on Windows.

    I’m sure if I’m wrong about that one of the regular readers will have more info to share. It’s probably also worth questioning whether Apple does anything on Windows to support scripting via Visual Basic.

  3. sjk Says:

    I use a Smart Playlist matching the condition “Kind starts with Protected” which includes both AAC audio and MPEG-4 video FairPlay files.

  4. Michel Fortin Says:

    There are COM interfaces for iTunes on Windows; I don’t know how far they go though. But what is going to be more interesting, if they go that route, is how long until someone build a fake iTunes application returning its own made-up purchase list.

  5. Daniel Jalkut Says:

    sjk: Great trick. Thanks!

    Michel: I don’t think Microsoft (or anybody) can possibly offer an “open-ended” buy-out deal. Because the number of songs some people own goes into the thousands, it would be unlikely Microsoft could afford to dole out licenses for an unlimited number of songs.

    So I suspect if there’s any truth to this rumor, it’s that Microsoft will offer to translate some smallish number of your songs, and won’t be too terribly concerned if you “take advantage of them” since they’ll be getting you onto Windows Media for at least those songs.

  6. Nathaniel Nutter Says:

    AppleScript does not work on Windows afaik. But I think AppleScript is overkill for this particular task. Searching for the extension .m4p will return all protected music but not books or video. But as sjk mentioned the functionality is built right into iTunes. You can even print the list of songs out once you have them in a playlist. One thing that works better on Windows in iTunes than on Mac is drag’n’drop. You could create the playlist as sjk mentioned and then drag all the tracks to a folder and it would copy them all over. Only problem here would be songs with the same filename.

    Anyways, I think as far as DRM goes iTunes is fine. Although I hate DRM.

  7. Happy-Coding Says:

    Share your library with Microsoft…

    Daniel Jalkut wrote in his Red Sweater Blog that Microsoft will possibly use information from the iTunes-Library for their new iPod competitor.
    The idea is that as a lure to switch to their service, Microsoft will offer to give you for free Windows Med…

  8. Spyro Says:

    Well it has already be said, but there’s no Applescript on windows (and non windows DRM on mac).
    However I’m sure the “iTunes Music Library.xml” thing is more then enough to find whatever you want.

  9. Arnaud Says:

    Well, you don’t have to use AppleScript for accessing the purchased songs, you just need to parse the iTunes Music folder! Just look for the .m4p extension and you’ll get all the tunes. As a bonus, this approach works for both the Mac and Windows platforms…

  10. ssp Says:

    For a real world script it could be an advantage to work on non-English systems as well.

    A Spotlight query for protected AAC files should be as simple but much more reliable.

  11. jburka Says:

    as many folks have noted, it’s easy to find .m4p files in the xml or by scanning a selected directory, or check for protected files via applescript (and perhaps COM) interfaces. The more interesting question is whether it’s possible to determine the owner of the file and whether the computer the m4p files are on are authorized to play them; otherwise, what’s to stop folks from trading their libraries of m4p files and getting matching drm’d windows media files?

  12. Daniel Jalkut Says:

    Good points, everybody. I hadn’t thought of just using the file system to search for files of the desired type. Surely the TWiT people must have been extrapolating to the point of determining ownership, computer authorization, etc., which while I’m pretty sure it will still be possible, is definitely less trivial than this example.

  13. David Dunham Says:

    I’ve got a lot of protected music on my Mac that I don’t own. (My wife owns it, and she’s authorized my machine.)

  14. Daniel Jalkut Says:

    David: that’s an interesting situation I hadn’t thought of. Good point!

  15. Stripes Says:

    mining ownership, computer authorization, etc

    Don’t forget if you include those things you still want to make sure you aren’t looking at the same song 5000 times! Otherwise cp or ln could make a very big music collection!

    Of corse even that is better then not checking ownership and such and finding out that dd or even touch can make a huge music collection.

  16. ebob Says:

    (A) Your blog font is too big. Way too big. I think amoebas can still read it.

    (B) Dvorak wrote something and you agreed? Or rather, you read it? That’s what comes of having fonts large enough to read, I guess.

  17. Daniel Jalkut Says:

    ebob: What a strange observation to make after all this time :) I think the size is pretty good. If I “make smaller” in Safari it seems too small. So I guess I could tweak it a tiny bit smaller in the code, but by no means does it seem “way too big” to me now.

    If you read the second paragraph you’ll see that I didn’t read anything at all. I heard it on a podcast.

  18. Jan Says:

    The font size is just right! :-)


  19. ebob Says:

    :-) Yeah, I’m strange. I also didn’t make my sarcasm more obvious. The fonts are too small, not too large. Actually, the response font is the tiny one. The main entry font size is bearable. But is is a very minor complaint. I can fix it for myself: I use OmniWeb and it has a per-site override for font size and site CSS.

    This relates to UI design, too. I have seen GUIs where the designers use the smaller label font provided by IB. And they select the small version of buttons and other graphic controls. I’ll grant that having worn spectacles from age 5 puts me on the wrong edge of the visual acuity bell curve. I see people who crank up the pixel density on their monitors and feel envy. But I can’t tell the OS to crank up the size of text and buttons, except by picking lower resolution screens. As useful as Zoom can be, I can’t bear how fuzzy it makes things.

    I also don’t always read closely, even when I make the font bigger. Yes, you did say you didn’t read Dvorak. He just happens to be one of multiple hosts on the podcast.

    See ya tomorrow night, Xcoder.

  20. Mithras Says:

    When I first heard about the “free replacement tunes” thing, I assumed that it would be in conjunction with a *subscription* service — i.e., it scans your iTunes library and downloads “Janus” time-limited DRM’d Windows Media versions of the songs you’ve purchased. The idea being that those songs are in a format the Xpod can’t play, but clearly you like, so it does you this favor.

    The songs are “free” in the sense that you don’t pay specifically for each download, but like all subscription songs, they’re kaput if you drop the service.

    When I read more, it appeared that this was not the way the idea was being talked about, but it still strikes me as the most plausible explanation.

  21. semanticpool. » Share your library with Microsoft Says:

    […] Jalkut wrote in his Red Sweater Blog that Microsoft will possibly use information from the iTunes-Library for their new iPod competitor. […]

  22. eDXWFScYfH Says:


Comments are Closed.

Follow the Conversation

Stay up-to-date by subscribing to the Comments RSS Feed for this entry.