Archive for the ‘Bug or Feature?’ Category

February 13 '14 - 12:42 pm
NEW: Scan For Double Entries

A funny thing started happening shortly after the introduction of iTunes 11 a few months ago. I began getting reports from Correspondents about usually reliable scripts that weren’t working correctly. After closer scrutiny, we were able to determine that some of their media files were appearing twice in the library. That is, they were finding pairs of identical tracks in the “Music” library that each pointed to the same file. Like this:


Two “Music” track entries, same file.

This is not ever supposed to happen. iTunes should not allow a file in a unique location to be added to its library more than once.

Now, this is not the same effect as copying a library track two or more times to a playlist, whereby only one library track is involved. Nor is it the same as when iTunes appends a number to a filename to distinguish it from an earlier-added same-named file. Nor do these tracks seem to be a flavor of iTunes Match duplicates (iTunes Match may or may not be a factor in their appearance). This issue manifests as sets of two distinct library track entries, each having different IDs and both having the same value for the Location property.

I don’t know how this happens. But it definitely has something to do with moving media files around the wrong way and doing so with iTunes 11. It may be a bug and it may even be fixed by now. But I don’t know. I only got it to happen once myself while I was experimenting convolutedly with a different issue and I haven’t been able to replicate it since.

Regardless of how these pairs came to be, how now to find them and then to deal with them? If you have a very large library, you may not even notice if you have any faux pairs.

My duplicate removal apps, Dupin and Dupin Lite, can detect this condition but won’t attempt to delete any files. If the file of one of the tracks were deleted, well, then neither track would be pointing to a file any longer and you’d have a lot of dead tracks. There’s a trick to using Dupin to delete an arbitrary one of each of the track pairs, but, technically, they’re not the sort of “dupes” that Dupin wants to handle.

So, the applet Scan For Double Entries simply looks through your library for track entries that have the same file path (that is, the same file location) and will copy these pairs of tracks to a discrete playlist so you can sort them out yourself. Presumably you’ll want to delete one of the tracks in each faux pair and I’m not sure that’s something you want an automated tool to do for you, you know, automatically.

More information and download is here.

November 30 '12 - 10:49 am
Interesting play Issue with MiniPlayer

As I mentioned below, I had to fix a script to workaround a problem playing a playlist when only one track had as yet been copied to it, which prevented the rest of the subsequently added tracks from being recognized by MiniPlayer and Up Next; thus, only the first track would play. Similarly, if you were to play (the AppleScript command) any track in a playlist, the following tracks will not play because they haven’t been recognized by MiniPlayer and Up Next (”No upcoming songs”).

Doesn’t go good when Mini Player is empty:

tell application “iTunes”

set aTrack to item 1 of selection

play aTrack

end tell

You can play the playlist and everything’s OK. You just can’t initiate play of the entire playlist by playing one of its tracks with AppleScript.

Goes good and loads in MiniPlayer:

tell application “iTunes”

set aPlaylist to view of front window

play aPlaylist

end tell

Additionally, I found that if the MiniPlayer was already loaded up with tracks, playing a track (via AppleScript) from anywhere would play that track and then resume with whatever is next in MiniPlayer.

Site contents © 2001 - 2014 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.