Archive for the‘Bug or Feature?’ Category

iTunes 12.2 introduces a new View by which to display tracks in a playlist: “Playlist”. It displays a nice header with artwork from the tracks in the playlist and abbreviated tag information. I like it.

Except that there is an issue when dragging tracks from a playlist set to “Playlist” view to another drag-and-drop enabled application. The pasteboard that should contain metadata information about the tracks being dragged (“com.apple.itunes.metadata” is the name of the pasteboard type) only supplies the file paths (“NSFilenamesPboardType”).

This affects my apps “Join Together”, “M3Unify” and “Playlist Assist”. The workaround is to either drag tracks while the playlist is in “Songs” view or drag the entire playlist by selecting its name in the Playlist Column and dragging.

This has been a problem for a couple of versions now. You can’t drag tracks from the “Audiobooks” library. There’s simply nothing in the “Tracks” node of the dragged pasteboard. Here’s what the pasteboard looks like in Console after trying to drag a track from the Audiobooks library to my app Join Together:

The current track and current playlist properties return a -1731 “unknown object type” error when run against a currently playing Apple Music track. That’s going to be a problem for scripts and apps that use those properties to identify a playing track. I couldn’t say if this is intentional or a bug.

The iTunes XML reports the main Library name as “####!####”. This is not necessarily AppleScript related, but several of my scripts may refer to this “Master” playlist by obtaining its name from the XML.

Good news, everyone. Today, in addition to releasing OS X 10.10.3 and iOS 8.3, Apple released Security Update 2015-004 for 10.9 and 10.8. This update appears to fix the EPPC bug introduced in Security Update 2015-002. The bug prevented access to Remote Apple Events over the EPPC protocal. Anyway, I had no problems with a couple of simple tests.

Apple’s latest Security Update (2015-002) apparently affects the EPPC protocol on OS X 10.8 and 10.9 and prevents Remote Apple Events from being sent/received correctly. Topher Kessler has more at MacIssues and there is this thread at MacScripter.

UPDATE: This issue was fixed with Security Update 2015-004 for 10.9 and 10.8.

Working with a script to get all the names of the playlists in iTunes, I noticed that two playlist names popped up in the latest iTunes 12.1 that aren’t actually visible in my Playlists: “Books” and “PDFs”. Here’s a script that illustrates:

tellapplication “iTunes”

geteveryplaylistwhosename = “Books”

–> {user playlistid 60870 ofsourceid 80}

geteveryplaylistwhosename = “PDFs”

–> {user playlistid 60873 ofsourceid 80}

end tell

While I almost certainly have had “PDFs” playlists in the past, this doesn’t appear to be some artifact from a past library. These playlists aren’t in the XML either, but they have persistent IDs and low index numbers. I tried using AppleScript’s delete command to remove them but it didn’t work, which leads me to believe these are hard-coded and are supposed to exist. Not sure what this is about (iTunes does use invisible playlists from time to time) but it may be inconvenient and inaccurate if you use a script that lists playlists.

Kirk has found a bug in iTunes 12 whereby selecting a batch of tracks and deleting their Genre tag via the Get Info panel inserts 8 spaces instead of empty text into each track’s Genre tag. This creates a Blank Genre that is actually displayed and selectable in Genre lists.

This AppleScript will correctly delete the Genre tag of each track in a selection:

tellapplication “iTunes”

setseltoselection

repeatwiththisTrackinsel

tellthisTracktosetitsgenreto “”

endrepeat

endtell

Also, any number of other scripts that can edit the Genre tag, like Multi-Item Edit, will get the job done.

[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:

tellapplication “iTunes”

settheSelectiontoselection

endtell

…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)”]