AppleScript Changes in iTunes 5.0
iTunes 5.0 was released on September 7, 2005 at an Apple Special Event in San Francisco's Moscone Center. The Motorola ROKR iPod/cell phone and iPod nano also debuted. New features in iTunes 5 include support for playlist folders, improved search capabilities, "Smart Shuffle" to provide more control over shuffle by artist and album, and parental controls to restrict downloading of iTMS music with explicit lyrics, ability to add lyric information to a track. iTunes 5 sports a new "shinier" metallic look
Overall Changes
First, iTunes 5 just plain looks different with a more refined metallic look, if you can call it that.
Importing and Burning Preferences are now under the Advanced Preferences. Two new Preferences are Parental and Playback, the latter being changed from Audio. Playback contains a "Smart Shuffle" slide bar that lets you control how likely multiple songs in a row by the same artist or same album will be played. You can also choose to shuffle by Songs, Albums, or Groupings now.
When you begin typing in the Search box, a "Search Bar" will appear that contains options for fine-tuning the search, much like how it works in Mail.
You can add Folders to the Source column and add playlists to them. Create a Folder from the File menu.
Tracks now contain a Lyrics section in their Get Info window. Apparently lyrics can be displayed in "some iPod models".
A track can be set to be bookmarkable in its Get Info window, along with being able to enable or disable the "Skip when shuffling" feature.
AppleScript enhancements
Three new commands have been added to the iTunes Suite in the Dictionary, updateAllPodcasts, updatePodcast, and download. The first two commands don't take any parameters, while download takes the address of a podcast.
The special kind property of playlist introduced in iTunes 4.9 contains a new "folder" parameter and "Video" parameter, perhaps suggesting that Video playlists are possible, however I haven't yet seen a way of creating such a thing.
You can access every track in every playlist in a Folder (This one contains all my Frank Zappa playlists):
tell application "iTunes" set the_playlist to playlist "Frank Stuff" every track of the_playlist end tell
It returns a list of references to all the tracks in the Folder.
Additionally, the playlist element now has a parent property which indicates the Folder a playlist may be contained in. It will generate an error if you run it on a playlist that doesn't have a parent. Perhaps this is a bug? However, you can test for the parent property of a playlist with "exists parent of this_playlist", where this_playlist is a reference to a particular playlist.
Regrettably, although you've always been able to "make" a playlist with AppleScript, you can't similarly "make" a Folder. And one more gripe: since Folders appear just above Smart Playlists in the Source column, dragging playlists one at a time to them is rawther inconvenient.
The track element has some new goodies!
The new property bookmarkable will make a track bookmarkable. (Thus rendering my "Make Bookmarkable" script antiquated.) This seems to work on any track, including MP3s and Protected AACs.
tell application "iTunes" if selection is not {} then set sel to selection repeat with this_track in selection try set bookmarkable of this_track to true end try end repeat end if end tell
The script above can be downloaded as Selected Tracks Bookmarkable.
A new description, long description, and category property of track refers to the "Description", "Long Description", and "Category" of podcasts. Only "Description" and "Category" are visible in the iTunes browser; "Long Description" is used by the iTMS and perhaps by other podcasting software. I believe "Category" may be part of the ID3 Tag standard, or at the very least emulates a tag like it.
The scripts Enter Category Text for Selected and Enter Description Text for Selected will allow you to apply your own text to these new tags in the selected tracks.
A new lyrics property allows you to set and get the lyrics of a track. I suspect people will want to use "Lyrics" for other information as well.
The shuffleable property takes a boolean true or false and allows or prevents the track from being shuffled.
More as it develops... See info on iTunes 5.0.1.