dougscripts.com

October 27 2014 - 7:38 pm

iTunes 12 Bug? Selecting Audiobook Tracks Fails

[UPDATE: The bugs described below appear fixed as of iTunes 12.1, January 30, 2015.]

Scripts and apps that use a selection of audiobook tracks from the Audiobooks library (notably Join Together, but others as well) will fail due to an apparent bug in iTunes 12. What appears to happen is that the selection object is always empty when Audiobooks library tracks are selected. Selecting audiobook tracks and then running a script as simple as this:

tell application "iTunes"

set theSelection to selection

end tell

...will always return an empty list, rather than a list of track references.

This will cause any script or app which expects a selection of Audiobooks library tracks to presume that no tracks are selected. It also affects such tracks that are dragged.

It doesn't appear to affect tracks outside the Audiobooks library, such as MP3 voice recordings, or CD books ripped as AAC, and so on.

Thus, changing an Audiobooks library track's media kind in its Get Info window to "Music" will avoid the issue; this will, of course, move the track out of the Audiobooks library to the Music library.

[UPDATE: A Correspondent suggests placing audiobook tracks in a separate playlist outside the Audiobooks library playlist. I can confirm that this works as well (and is likely a better workaround than changing the audio kind.)

Additionally, I have also found that a script cannot get a reference to the Audiobooks library playlist either. A "view of front window" when Audiobooks is selected returns a "unknown object type" error. This seems to indicate a problem with just the Audiobooks library and not audiobook tracks generally. Strangely, however, this works to get a ref to the Audiobooks library playlist: "set thePlaylist to (get some playlist whose special kind is Books)"]

I've filed a bug report.

Site contents © 2001 - 2024 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not be interrupting the one who is doing it.