AppleScript to Ease the Pain of the MINI Audio Interface

Thu 26 Mar

2009

About a year ago, I bought a MINI Cooper and I love pretty much everything about it except the audio interface. It seems when they were designing the MINI, the audio interface was last on the list of things to make easy to use.

My main gripe is the scroll knob. It’s fine for switching radio stations one at a time, or flipping through tracks on a CD, but when you have an iPod or a flash drive plugged in with a sizable amount of music on it, getting to the music you want to hear is often painfully slow. The problem is that no matter how fast you turn the knob, it scrolls through the music at a constant pace (slow).

I came up with an idea a while back to ease my pain and just got around to finishing it last night, so I thought I’d share. I wrote an AppleScript that organizes folders according to the letter they begin with. So, for example, let’s say you have a flash drive full of music that’s organized by artist (like iTunes organizes your music folder). The script will take all of the artist folders that begin with “A” and put them in the “A” folder, “B” in the “B” folder, etc. This way, when you plug the flash drive into your MINI and use the “DIR” option to browse the drive, you have a maximum of 27 folders to scroll through (one for each letter of the alphabet and one for artists that start with 0-9).

A few notes about the script:

  • First and foremost, I’m not responsible if the script reorganizes your music library in an undesired manner. The script worked for me using the steps provided on my Mac running OS X. However, I can’t predict all of the different factors that may cause the script to fail or sort your music incorrectly. I would suggest that you copy (not move) any music you run the script on to a separate folder other than your music library. This way, if something happens, it’s just a copy that you can delete and your music library will remain in its original state. Now that I’ve release myself from liability, if you do find a bug in the script, please let me know by leaving a comment.
  • The script is written in AppleScript, which will only run on Apple computers. If you are running Windows, I’m sorry, but the script will not work. I may look into writing something that’s Windows compatible if there is enough demand, but for now it’s Apple only.
  • Any folders that begin with “The ” will be placed in a folder according to the first letter of the second word. For example, “The Killers” would be placed in the “K” folder.
  • Any folder that begins with a non-alpha character (such as a number or special character) or begins with “The ” and the 5th character of the folder name is a non-alpha character will be placed in the “0-9″ folder.
  • Only necessary folders will be created. So, if you don’t have any folders that begin with “B”, a “B” folder won’t be created.
  • I used the script to organize my music by artist because this made the most sense to me, but there is nothing that should prevent you from using it on any folder. For example, if your music is organized by album and you want to sort it into folders based on the first letter of the album, it should work just the same.

Preparing your music for the script:

Since this is a fairly simplistic script, it relies on your music being somewhat presorted. If your music is not already sorted by artist, iTunes can do it for you:

  1. Open iTunes
  2. Click iTunes in the menu bar
  3. Click Advanced
  4. Check the “Keep iTunes Music folder organized” option

Installing the script:

  1. Copy the script to /Library/Scripts (you should see a bunch of other scripts that come with OS X in this folder).
  2. If you have the script menu icon in your menu bar (it looks like a little paper scroll), skip to “Running the script”.
  3. Open the AppleScript Utility. It can be found in /Applications/AppleScript/AppleScript Utility.
  4. In the Applescript Utility, check the “Show Script menu in menu bar” option.
  5. Close the Applescript Utility. You should now have the scroll icon in your menu bar.

Running the script:

  1. Click the AppleScript icon in the menu bar and select the “MINI Music Organizer” script in the drop down menu.
  2. Select the folder that contains your music organized by artist.
  3. Click Choose
  4. That’s it. The script will take anywhere from a few seconds to a few minutes to run depending on how much music you have. When it’s done, use Finder to browse to the folder you just ran the script on. It should now be organized by letter.

Download the script:
MINI Music Organizer.scpt

Share and Enjoy:
  • Twitter
  • Facebook
  • Reddit
  • del.icio.us
  • Google Bookmarks
  • Tumblr
  • Digg
  • StumbleUpon
  • LinkedIn
  • DZone
  • HackerNews
  • Posterous
  • BlinkList
  • NewsVine
  • Technorati
  • blogmarks
  • Fark
  • Live
  • MisterWong
  • MySpace
  • ThisNext
  • Slashdot
  • Yahoo! Buzz
  • Suggest to Techmeme via Twitter
  • PDF
  • email
Filed Under: apple, Programming

Comments

Leave a Reply