Archive for the
‘Tips and Info’ Category

May 31 '15 - 10:42 am
Check For Library Corruption With xmllint

A Correspondent recently reported that a script which needed to read the current “iTunes Library.xml” file was failing. This XML file, as you may know, is exported periodically by iTunes and is pretty much an abridged output of the actual iTunes database. Even the XML file exported by iTunes’ File > Library > Export Library… command was unable to be read. This suggested that there might be some corruption in the track entries, (I recently had a similar report and that database contained corruption that prevented the XML from being exported; the user reported that the XML had last been updated in 2012.)

iTunes can seem to behave normally even if there are tracks with corrupted track entry data or corrupted metadata in their files. So you might not even be aware of corruption until a third-party appliance elicits errors.

There is a command-line tool called xmllint that can find some corruption in the “iTunes Library.xml”. You can run it from Terminal, or in a script like this:

set f to choose file

set rez to (do shell script “xmllint –valid –noout ” & quoted form of POSIX path of (f as text))

This will error when it finds some badly encoded or improper UTF-8 text, which is often the culprit. Then it’s just a matter of finding the troublesome tracks in iTunes and fixing the problems if possible. Usually this means just editing the tags in iTunes.

May 16 '14 - 3:49 pm
Genius Playlists Can Be Shuffled

So I just discovered that everytime I play a Genius playlist it plays in the same order. My guess is that everybody else already knew that.

Today, however, I discovered that if you place a Genius playlist inside a Playlist Folder and then select the Playlist Folder, set it to shuffle, and then play, the songs play shuffled. That is, the tracks play in a different random order each time the Playlist Folder containing the Genius playlist is played.

When I told Kirk McElhearn about this he imagined that one could create several Genius Playlists based on the same Artist seed in order to maximize variety. So I tried that. And here’s what’s cool:

My presumption was that two (or more) Genius Playlists based on a similar seed each might contain duplicate tracks which would therefore be duplicated in the Playlist Folder that I put them in. But they are not. While the two Genius Playlists show 100 songs each, the total of tracks for the Playlist Folder is 174; the duplicate tracks don’t “register” in the Playlist Folder context.

I like this because I can maintain the Genius playlists longer without having to refresh or recreate them.

February 4 '14 - 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.

June 7 '13 - 4:22 pm
Search for Scripts from the Help Menu

I may have known this. But I guess I forgot about it. So I was pleasantly surprised when I found you can type the first few letters of a script you want to use (that is installed in ~/Library/iTunes/Scripts/ so that it appears in the iTunes Script menu) in the Search box in iTunes Help menu. These scripts are seen as menu items, so any script containing the entered text will show in the “Menu-Items” result. Then, if you hover the mouse over the script’s name, the actual Script menu pops up with the script highlighted and that hovering blue arrow pointing at it:

September 10 '11 - 9:49 am
Key Code Searching

Here’s a snippet I’ve been using for awhile which I just got around to posting on the key codes page. I keep my iTunes Column Browser set with Artists and Albums listed On Left. Whenever I’m looking for a particular album I run this script to select the Music library and put focus on the Search box:

tell application "iTunes"
	-- select the Music library
	reveal (some playlist whose special kind is Music)
end tell
tell application "System Events"
	-- bring focus to Search box - Command-Option-F
	key code 3 using {command down, option down}
end tell

I’ve given it a keyboard shortcut of Command-Option-S.

More information on AppleScripting iTunes with key codes and keystrokes is here.

May 13 '11 - 1:12 pm
Make Ringable at iPhone Ticker

German iPhone site iPhone Ticker posted a nice article and You Tube video describing how to use my free Make Ringable script to create ringtones from your iTunes tracks.

January 27 '11 - 11:26 am
Create Shortcut Keys to Select Libraries

There are no shortcut keys to select the Music, Podcast, TV Shows, and other libraries. But you can use AppleScript to create some. Here’s how:


January 18 '11 - 11:10 am
All Those Audio Formats

Via Lifehacker, this How-To Geek article is a great primer on the differences among digital audio formats.

January 10 '11 - 12:42 pm
Skip Back or Ahead Custom Mods

Recently, I was watching a DVR of a football game I had made with EyeTV. In general, I prefer to skip the parts that aren’t showing football players playing football. So, while watching the game on iTunes I used the script Skip Back or Ahead to jump ahead 120 seconds when necessary.

The thing about that script is that I didn’t exactly streamline the workflow. Here are the steps required to skip ahead 120 seconds:

  1. Click the iTunes Scripts menu, scroll, and click the script’s name to launch the script
  2. Enter the number of seconds in the dialog that appears–in this case the three digits “1-2-0”
  3. Click the “Ahead” button to dismiss the dialog

…and then the playing iTunes track, my football game, advances two minutes. But although it looks like just three quick steps it seems to take about a half an hour to perform. OK, not a half an hour. But it does seem kinda clunky to have to do a lot of mousing and key pressing just to perform a simple task like skipping ahead.

Here’s what you can do to streamline the script at your house.


September 16 '10 - 10:51 am
Take Your Album List WIth You

You probably know that you can use iTunes’ Print command to create CD box labels and stuff, which I’m guessing not many people need much any more. You can also print a list of all your Albums, sorted by Artist. Big whoop? Well, instead of printing it to paper, use the PDF Service in PDF Adder to add the listing as a PDF to iTunes’ Books library. It syncs to the iBooks app on your iPhone or iPad, too, so you can keep a portable list of all your albums with you. Update it once a month or so. Mine came to thirty-two pages! (Gotta work on my iPhone Cross-Country-Ski-Fingers Speed Scroll technique.)

BTW: I was reminded of album list printing when I heard Kirk chatting with Chuck Joiner about his new book, Take Control of iTunes 10: The FAQ (which will also sync nicely to your iBooks app).

Site contents © 2001 - 2016 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Legal.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.