dougscripts.com

January 2024

February 27 2014 - 6:57 am

iTunes 11.1.5 Released

Apple has released iTunes 11.1.5 which fixes a problem with unexpected quits while connecting a device and improves compatibility with iBooks. Not sure what issues with iBooks are addressed.

February 13 2014 - 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.

February 5 2014 - 10:30 am

NEW: Export Files From Playlists

Export Files From Playlists—playlists, plural—will export copies of the files of the tracks in a selection of playlists to a single user-selected folder.

More information and download is here.

February 4 2014 - 7:44 am

UPDATED: This Tag That Tag v3.4

This Tag That Tag v3.4 will assist with swapping, copying, and appending data between two user-chosen tags in selected tracks or tracks in the selected playlist:

Swap - swap data between tags, ex: ARTIST<->COMPOSER
Copy - copy data from one to another tag, ex: ARTIST->COMPOSER ARTIST
Append - append data from one tag to the end of another, ex: ARTIST->COMPOSER - ARTIST
Prepend - prepend data from one tag to the beginning of another, ex: ARTIST->ARTIST - COMPOSER

The latter three actions also provide an option to delete the info from the first tag after the copy.

This latest version adds "Category", "Description" and "Episode ID" text tags as options and a few minor tweaks and adjustments.

More info and download is here.

February 2 2014 - 8:17 am

Disc 1 of 1

A Corespondent laments:

My personal preference when dealing with the disc count field (1 of 2, etc) is to leave it blank for single CD albums instead of tagging them as "1 of 1." There is something about 1 of 1 that just bugs me so I try to clear those out. Can you think of anything you have that can search in those fields? Sorting the library by disc number [is an unsatisfactory solution] because every disc 1—regardless if there is a second disc—gets sorted.

Yeah. It would be easy to do a Multi-Item edit on these guys if you could only corral 'em all together somehow. But: sorting by Disc # sorts by Disc Number alone and ignores the Disc Count so the "1 of 1" tracks are not necessarily sorted together; rather, they're sorted by Album (all the Disc 1 albums A-Z, followed by all the Disc 2 albums A-Z, and so on). Smart Playlists are of little use to gather up these tracks since Disc Count is not a smart criterion.

So here's a script that will look at each track in a selection or all the tracks in the selected playlist; if the track's Disc Count is 1 the script will set it to 0, effectively blanking it:

tell application id "com.apple.iTunes"

set thePlaylist to (get view of front window)

set sel to selection

if sel is {} then

# all tracks in playlist

repeat with i from 1 to (get index of last track of thePlaylist)

my processTheTrack(track i of thePlaylist)

end repeat

else

# selected tracks

repeat with i from 1 to (length of sel)

my processTheTrack(item i of sel)

end repeat

end if

end tell

to processTheTrack(t)

tell application id "com.apple.iTunes"

try

if disc count of t is 1 then set disc count of t to 0

end try

end tell

end processTheTrack

You can save that in AppleScript Editor named whatever you like and using "Script" as the file format to your ~/Library/iTunes/Scripts/ folder whereupon it will appear in the iTunes Scripts menu.

The script iterates through each track individually, so if you run it against your entire Music library playlist you'll have time to file nails, tidy bookshelves, re-string guitar, or perform some other menial task.

UPDATE: To eliminate the disc number as well (although I prefer to keep it) change the handler to this:

to processTheTrack(t)

tell application id "com.apple.iTunes"

try

if disc count of t is 1 then

set disc number of t to 0

set disc count of t to 0

end if

end try

end tell

end processTheTrack

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.