AppleScript is something of an unsung hero. It provides scope for automating 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 pre-built 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 extra functionality is yours.
If you've a pretty big music collection, keeping it in good shape can take time, and with thousands of tracks things can slip through the net. Scripts can assist you with management tasks, taking minutes or seconds to do what would usually take you hours or more.
One of the best 'house cleaning' 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 box to inform you of its progress, and you also get an optional text-based log file at the end, telling you which entries have been deleted. On our 13,500-track test library on a bog-standard 24-inch iMac, this entire process took under a minute.
Tracks Without Artwork to Playlist is in a similar space. It enables you to select a library, playlist or an arbitrary bunch of tracks and copy 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 five minutes to churn through our 13,500 tracks, finding about 1,500 that lacked artwork.
With a 'no artwork' playlist in place, it's a simple process to send these tracks to Album Artwork Assistant in order to grab artwork online.
TAKE A SHORTCUT: If you regularly use a script, apply a keyboard shortcut via Keyboard Shortcuts in System Preferences
On the playlist front, another great 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 be used to deal with metadata issues, without you having to open a single Get Info window.
Quite often, the data iTunes downloads when you import tracks from CDs by fairly obscure artists isn't accurate. 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 deal with 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 niggles with track data 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 the likes of '[disc 1]' at the end, this script helps remove that information quickly and easily.
Once your track data is in order, 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 ten-second bursts from two-minutes into every track from a specified playlist.
Another favourite is Make Bookmarkable, which attempts to turn 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.
Our final set of scripts involves taking your experience outside of iTunes in various ways. The first pair deals with discovering more about what you're listening to.
Search Wikipedia and Google Video Search work in similar ways: select a script and a dialog appears asking whether you want to make a search based on the currently playing track or currently selected track. You're then asked to select a category to base the search on.
INSTANT INFO: Search for an artist or album on Wikipedia directly from within iTunes simply by using a little script
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.
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 manually open the file it outputs.
Another export option worth a look is Playlist to papercdcase.com. This enables you to 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 you get your origami skills in order.
First published in MacFormat Issue 222
Liked this? Then check out 40 cool OS X tips to save you time and effort
Sign up for TechRadar's free Weird Week in Tech newsletter
Get the oddest tech stories of the week, plus the most popular news and reviews delivered straight to your inbox. Sign up at http://www.techradar.com/register