Archive for the ‘Bugs’ Category

December 8 '11 - 4:37 pm
Thousands of Empty Playlists?

I’ve been hearing of an iTunes Match glitch that somehow or another creates thousands of empty playlists. Here’s a script that will delete every empty playlist:

tell application “iTunes”

set y to (get index of last user playlist)

repeat with i from y to 1 by -1

try

set thisPlaylist to user playlist i

if special kind of thisPlaylist is none then

if not (exists track 1 of thisPlaylist) then

delete thisPlaylist

end if

end if

end try

end repeat

end tell

It may time-out because the number of actions it has to perform is so large. Just run it until the empties are gone.

March 17 '11 - 12:03 pm
Artwork-Related Scripting Bug Follow-Up

Not long ago I posted about a possible bug introduced with iTunes 10.2 regarding reading PICT file data for use as track artwork (Possible Artwork-Related Scripting Bug in iTunes 10.2?). Essentially, a tried-and-true AppleScript routine for importing PICT image data fails in iTunes 10.2. After some investigation, it turns out that iTunes 10.2 now uses ImageIO for all image handling instead of QuickTime and the ImageIO framework no longer supports PICT files. No one should really be surprised since the PICT format has largely been deprecated. But even so, until recently, PICT was still supported in iTunes.

So it’s not a bug but a side effect of modernity.

The fix for iTunes 10.2 and above is to simply read in the data from a PNG or JPEG file:

tell application "iTunes" to set data of artwork 1 of theTrack to (read (file targetImageFile) as picture)

Where theTrack is a reference to a file track in iTunes and targetImageFile is the path to a valid PNG or JPEG image file.

A couple of my scripts that need the fix will be posted later today.

March 7 '11 - 12:09 pm
Possible Artwork-Related Scripting Bug in iTunes 10.2?

Several users have reported, and I can verify, that an AppleScript routine used to apply image data to a track as artwork fails with an error -206 when used on iTunes 10.2. Essentially, the error is tripped when the following code–or similar–is run; theTrack is a reference to an iTunes file track and thePictFile is a valid PICT image file:

set data of artwork 1 of theTrack to (read (thePictFile as alias) from 513 as picture)

There are a couple a scripts here that use a variation of that (Re-Apply Downsized Artwork is one) and thus they will error when run with iTunes 10.2. The snippet works fine in versions before 10.2. I can use it on v10.1.2, for example. It might be a bug so I’ll keep my eye on this.

January 11 '11 - 2:05 pm
Fix a iOS Sorting Anomaly

Correspondent Roy Gatsby brought this GigaOM article to my attention which discusses a supposed bug in the latest iOS regarding the sorting of TV Shows on iOS devices. Apparently, non-iTunes Store TV Show episodes may not sort correctly if the Artist is not also the Show name. The recommended fix, therefore, is to open up a track’s Get Info window and manually copy the Show tag text and paste it to the Artist tag.

Wait. Manually?

I recommend using the “Put This in That” script from the This Tag, That Tag Scripts collection. It will allow you to copy Show to Artist on a batch of selected tracks.

By the way, changing the Artist tag does not compel iTunes to change the location of the TV Show file since iTunes does not organize TV Shows in the iTunes Media folder by the Artist tag as it does with Music files.

September 2 '10 - 12:03 pm
iTunes 10 Breakage (Nothing Serious)

Some AppleScripts from this site use a routine that checks for the version of iTunes you are running. Some of the scripts that use these routines are broken under iTunes 10. So when running a script with iTunes 10.0 you may run into a dialog that erroneously reports something like “This script requires iTunes 6.0.2 or better”. This is not a bug in iTunes, but a problem with the way the script does the version check. (Long story short: the version number once was a number, but more modern versions of apps use a string. Thus “10.0″ is not necessarily greater than “9.2.1″ and the routine fails to accommodate this.) You can edit/comment out the version check routine yourself or wait until I get around to fixing the handful or so scripts that are affected. In that case, let me know if you see the error.

July 25 '10 - 8:28 am
Scripting Bug with iTunes 9.2.1?

I have received two reports over the past couple of days of some unusual behavior that occurs with iTunes 9.2.1 and some AppleScripts. After running a script that changes the track name tag, the track’s Genre tag is replaced with a number in parentheses, eg, “(10)”. In such cases, it appears that this is a number representing the specific Genre, such that Rock = 30, Jazz = 10, and so on. Like this:

Each report involved a different script which until now presented no problems. Experience suggests that this is not an issue with the scripts (since nothing about the script has changed) but with iTunes.

I have not seen this behavior myself, but I have not yet done any rigorous testing. Since I have only received two reports at this point my guess is that this may be a problem with something else and iTunes; a misconfigured plug-in or background app. But that may be wishful thinking and the problem may indeed just belong to iTunes.

If you have seen any behavior like this please let me know as soon as you can. I’d like as much information as possible before I test and eventually report this to Apple.

[UPDATE: see here for the fix.]

April 3 '10 - 7:35 am
Join Together v6.0 Bug Reports

Several users have reported (and are helping me trouble-shoot) a bug in the latest Join Together, which is v6.0. Essentially, the issue seems to be that the join never leaves “Finishing export”. I’m working to solve the issue and have an update early in the coming week. Thanks for your patience.

October 31 '09 - 10:17 am
Confirmed: iTunes 9.0.2 Script Menu App Bundle Bug

iTunes 9.0.2 will not display AppleScript Application Bundles in its Script menu. The apps are still where they are supposed to be, ~/Library/iTunes/Scripts/ or /Library/iTunes/Scripts/, and they still work when fired from the Finder. It’s just that iTunes doesn’t recognize them for inclusion in the Script Menu. Apple is aware of the issue.

This is a problem in Snow Leopard since the default build type for AppleScript applications is the bundled type–there is no longer an option to create “plain” application scripts. Thus any AppleScript applications created in Snow Leopard will not appear in iTunes’ Script menu, as well as, of course, any AppleScript application ever saved as Application Bundle.

Scripts affected will display Kind: Application (Universal) in their Get Info window.

Affected apps that you simply gotta access while iTunes is frontmost can be copied/moved to ~/Library/Scripts/Applications/iTunes/ and they will appear in the system-wide Scripts menu.

October 30 '09 - 1:39 pm
Apps Not Displaying

On further investigation, it appears that AppleScript applications with bundles are not displaying in the iTunes 9.0.2 Script menu. This means that any app written under 10.6 will not appear since app bundles are the default application build style. Apps written without bundles pre-10.6 will display. Regular scripts, with or without bundles, seem fine.

UPDATE: ScriptPal is a good workaround.

October 30 '09 - 1:26 pm
Interesting iTunes 9.0.2 Mystery

A Correspondent alerted me to an unusual behavior with iTunes 9.0.2 and the script application Needle Drop: it doesn’t appear in iTunes’ Script menu, under Leopard or Snow Leopard. I don’t know what to suspect yet.

Of course, it still works if you double-click it in the Finder, but that kind of defeats the purpose of having a Script menu.

I will investigate.

Site contents © 2001 - 2012 Doug Adams and weblished by Doug Adams, dougscripts AT mac DOT com.
All rights reserved. Legal.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc.