Scripting Bridge and iTunes 9


I've been working sporadically on a project that would allow me to load chunks of metadata into iTunes as I rip my DVDs for viewing on the AppleTV. (This is especially annoying, since I have both the ripped material and the metadata for hundreds of shows).
Last time I looked at the code was at the time of iTunes 8. The major feature I’m missing is the ability to set the rating of the content, to keep the kids from R, MA, Unrated content. Unfortunately, that isn’t in the current version of iTunes 9.
However, running scripting bridge on the current version, does supply a considerably different file
The enum
and typedef
declarations are defined in a standard more with the current Apple style, for example: (the code is prefixed with my initials because a leading “i” was driving me bonkers.
Old format
enum SATunesEKnd {
SATunesEKndTrackListing = 'kTrk' /* a basic listing of tracks within a playlist */
SATunesEKndAlbumListing = 'kAlb' /* a listing of a playlist grouped by album */
SATunesEKndCdInsert = 'kCDi' /* a printout of the playlist for jewel case inserts */
} SATunesEKnd;
New Format
enum SATunesEKnd {
SATunesEKndTrackListing = 'kTrk' /* a basic listing of tracks within a playlist*/,
SATunesEKndAlbumListing = 'kAlb' /* a listing of a playlist grouped by album */,
SATunesEKndCdInsert = 'kCDi' /* a printout of the playlist for jewel case inserts */
};
typedef enum SATunesEKnd SATunesEKnd;
This is much more readable and in line with the way we document these types of enums (so that Quick Help parses the typedef correctly).
A few other constants changed, but nothing major I saw upon a quick look.
The data type for artwork went from id
to NSData
.
A new field was added releaseDate
. So this metadata could be added to files now using the bridge.
The only other change of note was the SATunesFileTrack
object property location became readonly
(which it probably should have been all along).
So, while progress is there, and I love the new enum format (because the docs are changing to it) I was a bit disappointed with the lack of a parental rating field.
Ah well, maybe next time.

