dougscripts.com

Archive for the
‘Bug or Feature?’ Category

July 4 '15 - 10:01 am
iTunes 12.2 Playlist View Issues

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.

Playlist in playlist view

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.

I’m working on fixes for those apps.

July 1 '15 - 5:07 pm
play with once Is Broken

(I have updated this post. See below.)

To play a track just once and then stop you’re to do something like this, using the once modifier with the play command:

tell application “iTunes”

set aTrack to item 1 of selection

play aTrack with once

end tell

Well, that doesn’t work in iTunes 12.2. The tracks just keep on coming. In fact, a few times some random track in some other playlist started playing afterwards or queues up in Up Next.

UPDATE (July 1, 2015, 6:39PM) – I think I may be wrong about this. I cannot replicate the original set of issues I describe above.

July 1 '15 - 8:23 am
Dragging from Audiobooks Still Fails

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:

Pasteboard contains no track entries

July 1 '15 - 6:06 am
iTunes 12.2 and AppleScript Issues, Volume 1

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.

More as it develops.

April 8 '15 - 7:51 pm
Security Update 2015-004 Fixes EPPC Issue

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.

Fast turnaround, actually.

April 1 '15 - 3:46 pm
Latest Security Update Affects EPPC Protocol

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.

February 1 '15 - 11:40 am
Books, PDFs Playlists?

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:

tell application “iTunes”

get every playlist whose name = “Books”

–> {user playlist id 60870 of source id 80}

get every playlist whose name = “PDFs”

–> {user playlist id 60873 of source id 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.

UPDATE: Kirk speculates that ebooks may be returning to iTunes.

January 30 '15 - 6:23 pm
iTunes 12.1

Apple has released iTunes 12.1 with fixes to device syncing and a new widget for controlling iTunes in Notification Center.

Things fixed: selection object for selected tracks in Audiobooks library works, reference to Audiobooks library via “get view of front window” command works. Things not fixed: View Options for CD display, Command-I shortcut for CD “Get Info”. More as it develops.

December 30 '14 - 11:10 am
Blanking the Genre Tag in iTunes 12

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:

tell application “iTunes”

set sel to selection

repeat with thisTrack in sel

tell thisTrack to set its genre to “”

end repeat

end tell

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

October 27 '14 - 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 - 2015 (that's right: 2001) Doug Adams and weblished by Doug Adams, dougscripts AT mac DOT com. About.
All rights reserved. Legal.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no affiliation with Apple, Inc.