Turn iTunes Up to 11
Posted 07/27/2010 at 2:46pm
| by Craig Grannell
Scripts Make iTunes Sing
AppleScript is something of an unsung hero. It easily automates repetitive tasks, but few users ever go near it. If you’re an iTunes power user, scripts are a must, but you needn’t hack away in AppleScript Editor--many prebuilt iTunes scripts are available online. All you need to do is download them, plonk them in the iTunes Scripts folder, wait a second or two, and the extra functionality is yours.

If you regularly use a script, apply a keyboard shortcut via Keyboard Shortcuts in System Preferences.
The walkthrough below shows you how to set up and manage scripts, so we’ll concentrate on the best available scripts. All of the scripts mentioned are available for free from the Doug’s AppleScripts for iTunes website (dougscripts.com/itunes).
Track Management
If you’ve got a pretty big music collection, keeping it in good shape can take time--way, way, way too much time. Scripts can assist you with management tasks, taking minutes or seconds to accomplish what might take you hours or more.
One of the best housecleaning scripts is Super Remove Dead Tracks. This finds songs in your library that are no longer available on your Mac. Every 500 tracks, it throws up a dialog to inform you of its progress, and the optional text-based log file at the end tells you which entries have been deleted. On our 13,500-track test library, this entire process took under a minute.
Tracks Without Artwork To Playlist is similar--you select a library, playlist, or an arbitrary bunch of tracks, and the script copies songs without artwork to a new playlist. On activating the script, all you need to do is click Proceed, choose a name for your playlist, and wait for a bit. On our iMac, the script took about 5 minutes to churn through our 13,500 tracks, finding about 1,500 that lacked artwork. With a No Artwork playlist in place, it’s simple to send these tracks to Album Artwork Assistant to grab artwork online.
Another great playlist script is Gather Up The One-Hits. It collects tracks where the artists are each represented in your library by just a single song. Chances are, this will mainly comprise content from compilations, but we found a bunch of one-offs we’d grabbed from the iTunes Store and subsequently forgotten about.
Track Info and Playback
Along with rapidly cleaning up your library, scripts can deal with metadata issues, and you don’t have to open a single Get Info window. Quite often, iTunes downloads inaccurate data when you import tracks from CDs by obscure artists--a common error is the artist and track name fields being reversed. The Swap This With That script from the This Tag, That Tag Scripts compilation can handle this. Launch the script, select a tag to swap from and another to swap to, and your songs’ data is amended. However, be aware that there’s no undo. If your metadata issues are subtler, investigate Track Names To Sentence Caps and Track Names To Word Caps (both of which reformat cases in track names) and Remove N Characters From Front or Back. The last of those enables you to remove a specific number of characters from the start (‘front”) or end (“back”) of a selection of song titles. So if some song titles have track numbers at the start or “disc 1” at the end, this script removes that information quickly and easily.
Scripts can also assist with playback controls. Needle Drop enables you to audition a selection of tracks in automated fashion, after defining playback length and an intro point. For example, you can play 10-second bursts from 2 minutes into every track from a specified playlist.
Another favorite script is Make Bookmarkable, which turns the file type of selected AAC tracks into M4B, thereby making them “bookmarkable,” so playback resumes where you left off. Make UN-Bookmarkable reverses the process.
External Considerations
Search Wikipedia and Google Video Search search the web for more information about your music, working in similar ways: You select a script, and a dialog asks whether you want to search based on the currently playing track or the currently selected track. You then select a category to base the search on. For Wikipedia, you can select the artist, album, or composer. For Google Video, you choose between song, artist, and album. The dialogs aren’t pretty, but they get the job done and save time.

Search for an artist or album on Wikipedia directly from within iTunes simply by using a little script.
Another set of scripts enables you to export track information from iTunes. Although this can be done using File > Library > Export Playlist, the resulting text file is complicated, huge, and unwieldy. Instead, we recommend Album-Artist To HTML Table, which exports a list of your artists and albums (and, optionally, associated tracks, although processing that information takes a long time, so we don’t recommend it) to an HTML document that you can open in a web browser. The script has a couple of quirks: you need to reorder your track list to Album By Artist for best results, and don’t let the script open a browser when it’s finished, or you’ll likely get an error. Instead, click Done and then manually open the HTML file it outputs.
Another export option worth a look is Playlist To Papercdcase.com. It lets you export up to 28 tracks from a playlist to papercdcase.com (the site opens in Safari), which cunningly formats the data into a PDF file that can then be turned into a CD case if your origami skills are up to snuff.
Back Up Your iTunes Folder

The add-ons mentioned elsewhere in this feature do relatively little to affect the content of your iTunes library. At most, they add a little data here and there, such as ratings and new artwork, and these things are easy enough to revert or delete at a later date. Scripts in iTunes can be a very different matter, because some of them automate complex and “destructive” processes, including reworking and deleting tracks. We’re not trying to scare you off--iTunes scripts can often be very handy timesavers--but we do suggest that you don’t just start using scripts blindly. Before you work with scripts that do anything major to your iTunes library, ensure that you first back it up. The iTunes folder--including your music, other digital content, and databases--lives in the Music directory inside your user folder.
How to Manage Your Scripts Folder
1. Create a Scripts Folder

If you haven’t installed scripts before, you won’t have a Scripts folder to use. To add one, quit iTunes, use the Finder to access ~/Library/iTunes (the Library folder that’s found inside your user account’s home folder), and if a Scripts folder isn’t present, create a new folder called Scripts.
2. Install and Remove Scripts

Managing scripts is a case of drag and drop. To install a script, drag it into the Scripts folder mentioned in Step 1. To remove one, drag it out of the folder or trash it. It’s best to do such management when iTunes is closed, but iTunes typically tracks script changes well.
3. Check Things in iTunes

Launch iTunes. After installing a script, you’ll see a script icon in the menu bar between the Window and Help menus. This is where you can activate the scripts. Scripts can even have keyboard shortcuts assigned in System Preferences > Keyboard > Keyboard Shortcuts, just like other menu items.