We all enjoy music, right? Playing your favorite music on a computer isn’t difficult. But what if you are a Mac user having hundreds of GB’s of MP3 files on an external harddrive?
When I bought a new MacBook it came with iTunes as the default (and probably best) music player from Apple. I’m not going to discuss what music player is better. People claim you’re able to work with an Apple right out of the box, so iTunes it is.
Having my music stored on an external drive will keep my laptop’s harddrive clean and gives me enough free disk space for storing documents, pictures, games, videos…you know, fun stuff.
Like many people I prefer having my own folder structure which is used to organise all of my music. However, smart people at Apple haven’t included an option that will let iTunes synchronize with a custom folder. Luckily we can use Automator to do this for us. Imagine adding hundreds of CD’s manually to your library!
Here’s my situation: Apple MacBook (running iTunes 7.2) and a LaCie 350 GB USB External Drive (containing all of my music).
The automator script
I’m using a total of 3 actions:
- 1) Ask for Confirmation
- 2) Find Finder Items (optional ‘date modified’ check)
- 3) Add Files to Playlist
Look at the screenshot to see detailed information about each action. The second action is the most important one. You will need to specify the main folder that holds all your music (in my case Music on the external drive named Nanako).
I’ve added two criteria. One that searches for mp3 files and a second one (which is not mandatory) that will check for modification date (last 2 weeks). I’ve added this second rule, because reloading all our mp3′s will take a very long time. Using the second rule drastically decreases loading time and will only add songs that are modified during the last 2 weeks. Change the date according to your own preference.
Creating rules with Automator. Change them to your own needs. See full image
When running this script it will search inside your custom folder for all mp3 files that have been modified (in this case “added” to your folder) during the last 2 weeks and will add them to your iTunes Library.
Tracks that are no longer available in iTunes (e.g. because you’ve deleted a CD manually), as indicated by a “!”, can be removed using Super Remove Dead Tracks.
Installation & Usage
Download the Automator script here: automator-itunes-library-sync.zip
Note: The following may not work on OS X 10.6 Snow Leopard.
Location of where to place the script. See full image
Place this script in /Username/Library/Workflows/Applications/Finder.
If the workflow directories don’t exist, you have to create them manually. When done, the script will be available to you with a simple right mouseclick (on some free desktop space). Select Automator -> Synchronize Library and your done. When running this script for the first time, open Automator and disable the “Date Modified” rule because we want to add all the songs first. When done you can enable the rule again.
Activating the script with a right mouseclick. See full image
I know a lot of people are waiting for an iTunes with a built-in synchronization function. I hope this might solve the problem people have now until iTunes will have such a function. I’m no expert with Automator, so if you have any comments, or suggestions regarding this script, please use the comment form below.
Tip: Using multiple iTunes Libraries
Press and hold the option (alt) key when launching iTunes. Doing so will let you control multiple iTunes Libraries. I’ve got two libraries running, one with music on my external drive and another one with some songs stored on my MacBook.
2008-01-11 – version 1.1
- Changed the script to search for â€œtype: audioâ€
2007-04-07 – version 1.0
- First release