March 11 '09 - 8:56 pm
Apple Released iTunes 8.1 today (v8.0.2 was the previous version). Among the new features are its ability to handle larger libraries more speedily, iTunes Plus (256kbps AAC) importing via CD, and Genius playlists that will scour for video media.
I know of at least one AppleScript enhancement. A track’s played date and skipped date properties can now be wiped by setting either to 0 (zero) or missing value. Before, you could never set these properties to anything but a date. While you could set played count and skipped count to 0, the only way to fudge the played or skipped date was to give it a date in the past, like date “January 1, 1970″. Now, you can do this:
tell application "iTunes"
set sel to selection
repeat with aTrack in sel
tell aTrack
set played date to missing value
set played count to 0
-- and/or
set skipped date to missing value
set skipped count to 0
end tell
end repeat
end tell
I’ll have a look for any other changes.
posted in Apple, AppleScript Syntax, Updates, iTunes
January 2 '09 - 7:06 am
After playing around with the “show-library-playlist” setting, it looks like you do have to set “hide-library-playlist” also. So, to show the “Library”, run these two commands in Terminal one after the other (that is, press Return after entering each):
defaults write com.apple.iTunes show-library-playlist -bool TRUE
defaults write com.apple.iTunes hide-library-playlist -bool FALSE
To hide the Library again, run the same commands, but reverse the TRUE/FALSE values.
posted in AppleScript, AppleScript Syntax, Controlling iTunes, iTunes, unix
January 1 '09 - 1:59 pm
I’m not certain if this has been mentioned anywhere–I haven’t seen it–but I found the defaults command for displaying the entire iTunes library. Remember when you actually had a large playlist named “Library”, before Apple split it up into–what I call–”Master” libraries of “Music”, “Movies”, “Podcasts”, and so on? The “Library” listed everything in your iTunes library. Well, you can get that back using this command in Terminal:
defaults write com.apple.iTunes show-library-playlist -bool TRUE
Quit iTunes before entering the command. When you restart you’ll have a new playlist named “Library” at the top of your Source list, above “Music”.

If you want to remove the “Library” again, use this command in Terminal:
defaults write com.apple.iTunes show-library-playlist -bool FALSE
There is a second preference called “hide-library-playlist”, which I at first thought would have to be set in tandem with the opposite of “show-library-playlist”, but this doesn’t seem necessary. In fact, you can set one or the other, apparently, and get the desired result; that is setting “show-library-playlist” to TRUE or setting “hide-library-playlist” to FALSE amounts to the same thing. Also, for AppleScript purposes, this playlist can be referenced as library playlist 1; it always could be, but now it is visible.
posted in AppleScript, AppleScript Syntax, Controlling iTunes, Tips and Info, iTunes, unix
September 10 '08 - 12:28 pm
As I hinted at yesterday Genius playlists are a new “species” of playlist. Several scripts are affected by their inability to correctly distinguish Genius playlists from other playlist types. I will be working on fixes for them in the coming days. I think, in fact, that you can pretty much attribute any failings of AppleScripts that did work before iTunes 8 to the appearance of one or more Genius playlists. You may want to verify this by shutting Genius off and trying the errant script again. While some AppleScript behaviors have been updated/fixed in iTunes 8, I have not (yet) noticed any new AppleScript features that would otherwise cause scripts to error.
posted in AppleScript, AppleScript Syntax, Updates, iTunes
September 9 '08 - 9:21 pm
As far as AppleScript is concerned, iTunes 8’s Genius playlists are user playlists with a special kind of none and a smart value of true, and therefore they are indistinguishable from Smart playlists. I don’t know if eventually there will be a special kind value of “Genius”, but for now distinguishing a Genius playlist from Smart playlists will not be easy.
posted in AppleScript Syntax, Updates, iTunes
March 12 '08 - 8:25 am
After nearly ten years, Apple has finally updated the Introduction to AppleScript Language Guide. Its layout and organization is more consistent with other Apple Developer Connection documentation and is much easier to grok (and much less 1999-internet-looking). It is specifically geared towards AppleScript 2.0 and Mac OS 10.5 or later.
posted in Apple, AppleScript, AppleScript Syntax
February 12 '08 - 2:26 pm
A lister on the AppleScript mailing list writes:
The Scripting Interface Guidelines agree with you: make and delete should be used to create/destroy objects completely, while add and remove should be used to add/remove existing objects to sub-groups. e.g. Compare Address Book, which uses add and remove to add/remove existing person objects to group objects. iTunes predates the SIG, however, and while its scripting interface is fairly extensive it does suffer a number of longstanding design quirks.
Yep. I’d be happy if they just made it like it used to be.
posted in AppleScript, AppleScript Syntax, Bugs, iTunes