I store most of my iTunes tracks in Apple’s AAC encoding format, but from time to time I find it useful to convert some tracks in my library to MP3 format. While AAC is convenient and works on my iPod, iPhone, etc., I have to concede that MP3 format is a little more universal.
In the iTunes “Advanced” menu you’ll find a convenient conversion item, which lets you convert the encoding of a selected song file to whatever your default import encoding is. The problem is, since I’m always importing as AAC, the only option it gives me is to convert to AAC:
To use iTunes to convert a song to MP3 format, I would have to open up Preferences, click the Import Settings button, and change my default encoding choice to the MP3 encoder. Then I would have to close preferences, do the conversion, and then preferences and switch my encoding choice back to AAC.
AppleScript to the rescue. Because iTunes exposes an attribute “current encoder”, and because AppleScript exposes a command “convert”, I can do all the mucking about behind the scenes in a quick-running script that performs theses steps:
- Save the current encoding setting.
- Switch to the MP3 encoder.
- Convert the selected songs.
- Set the encoder back to whatever it was
Download the Convert to MP3 script. Install it in [Home] -> Library -> Scripts -> Applications -> iTunes. It will show up in FastScript’s iTunes-specific section, where you can assign a keyboard shortcut if you like.
Now when I want to convert songs to MP3 format, I just select them in iTunes, and press the keyboard shortcut I assigned to the script in FastScripts:
The conversion happens immediately and my encoding preference is not disturbed.