Convert To MP3

September 11th, 2009

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:

  1. Save the current encoding setting.
  2. Switch to the MP3 encoder.
  3. Convert the selected songs.
  4. 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.

12 Responses to “Convert To MP3”

  1. Harley Turan Says:

    I’ve always been annoyed by the way iTunes handles converting to another format, so that’s some really neat FastScripts functionality. However, it’s probably a bad example to use from an audiophile perspective, as converting from lossy to lossy format is not really a good idea :) Still, it’ll come in useful for the Apple Lossless tracks that I have in my library.

    Also, I just wanted to say that I’m a big fan of Core Intuition, keep up the good work!

  2. John Wenn Says:

    Unfortunately, for me it produces a 64kbps MP3 file, which naturally sounds horrible.

    I think the problem is you ask for:

    first encoder whose name is “MP3 Encoder”

    I think you would want to be more picky with your encoder, specifying a reasonable bit rate (256 sounds OK to me).

  3. Daniel Jalkut Says:

    Harley – glad you are enjoying Core Intuition!

    John – the trick is you can’t specify bitrate etc (as far as I know) from the AppleScript interface. But it isn’t stuck on 64kbps for the MP3 encoder, I think what happens is it uses whatever preferences you set the LAST TIME you used the encoder in Preferences.

    So if you open up preferences and switch to MP3 encoder, set high quality preferences, then switch back to AAC, I think the FastScripts-converted quality will now match your new MP3 defaults.

  4. Stuart Dootson Says:

    Thank you so much for this script!!!!

    I’ve left iTunes set to MP3 rather than AAC more times than I care to remember after converting an AAC to MP3!!!

  5. froodian Says:

    Thanks for this script – I often perform this task, and I’ve been doing it the “YUCK!” way. (You store aacEncoder but never use it, btw)

  6. Patrick Says:

    Which raises a question (which I’ll get to later). I have most of my iTunes library in Apple Lossless. When I move it to my 8BG iPod Touch, iTunes leaves the songs in lossless, which takes up too much space.

    So I convert a bunch of songs into AAC so that I can put the AAC-encoded songs on the Touch. Great. But now iTunes has duplicates of all of these songs (one copy in lossless, the other in AAC).

    So here’s the question: can I not create the duplicates, or delete them? Is there an AppleScript way to do this?

  7. scott Says:

    Wow. Did this blog post ever send me off on a fun tangent. I decided to make a snow leopard service to convert audio files in the finder to MP3.

    My encoder for itunes is set to AAC like yours, but there’s an import action in automator that lets you specify the encoder to use, and doesn’t change the default.

    I used that, then had it move the file to a different folder. Then I added an applescript in there to remove the track from my itunes library.

    This is something I do frequently as I produce segments for other people’s podcasts, and instead of firing up itunes and doing it manually, now I have an automated way of handling this.

    Thanks for the nudge and the jumpstart with your script!

  8. Tim Says:

    I’m curious as to what the menu item is in between the power icon and the volume icon! Inquiring minds want to know…

  9. Daniel Jalkut Says:

    Hi Tim – it’s the “Input Methods” menu which you can enable from the “Input Sources” section of the International pane in System Preferences.

    It’s useful for switching between keyboard layouts e.g. for different languages, but the reason I keep it handy is because you can use it to pull up the system unicode character viewer, which is pretty convenient sometimes in my work.


  10. Cindy Says:

    I get an error “AppleEvent Time Out”, I hit OK, and then the song converts but my preferences switch to MP3 rather than staying at AAC. I put the script in my Library–>iTunes–>Scripts. Do I need to create those Scripts -> Applications -> iTunes folders?

    Using latest version of iTunes in Tiger.

  11. Daniel Jalkut Says:

    Hi Cindy – not sure what’s going on there. When you run the script, does it show a dialog or something that could be blocking the script from finishing? I am afraid I don’t know what would cause the problem you are seeing. It should work fine from either script menu.

  12. mc Says:

    Thank you for the info. Just also want to share this other way of aac to mp3 conversion. See this http://mp3toaacconvert.com

Comments are Closed.

Follow the Conversation

Stay up-to-date by subscribing to the Comments RSS Feed for this entry.