Use two iTunes libraries and one Music folder
Mar 25, '05 10:15:00AM
Contributed by: joestalin
Suppose you are in a household with two Macs. Each person has a copy of iTunes installed. They both want access to the same music directory, but they both want it to be part of their own library. iTunes already makes it easy to share your music over a LAN, which is nice up to a point, but doesn't give you much flexibility: you can't assign star ratings to someone else's music, make playlists, or load up an iPod with it. What you really want is for all that music to be yours (and all your music to be similarly available to your cohabitant).
Here's the recipe. I'll assume you have a LAN set up already.
- On each computer, go into System Preferences: Sharing: Services, and enable "Remote Apple Events."
- Designate one computer as the "music host;" the other will be the "music client."
- On the client, connect to the host, and mount the hard drive on the host that contains the iTunes music folder. Go into iTunes Preferences: Advanced on the client and set it to use the same folder as the iTunes music folder as the host (the one on the host's computer).
- In the interest of good file management, you probably want to go into iTunes Preferences: Advanced on the host and enable "Keep iTunes Music folder organized" and "Copy files to iTunes Music folder when adding to library." However, on the client machine, I think you will need to disable these (otherwise multiple computers will contend over where and how the files should be organized). If the client already has music files stored locally, relocate those files to the host, and remove them from the client. Add those tracks to the library of the host computer manually.
- Find and remove the files "iTunes Music Library" and "iTunes Music Library.xml" (or create an archive of them) from the folder ~/Music/iTunes on the client machine. Manually add all the tracks on the host machine to the client's copy of iTunes by dragging them into the iTunes window. For very large collections, you should probably do this in chunks (iTunes seems to get confused otherwise). I added all the artists starting with A at once, then B, etc. Took a while, but it worked.
- Now both users have access to the same music directory, can make their own playlists, set their own ratings, load up their own iPod, etc. The problem is that the situation is static--if anyone adds a new track, things get out of sync, and only that user will have access to that track (without additional futzing).
- That is where this mystical-magical AppleScript comes in. This was pretty much written by "deeg" (with some nudging from me) in the Applescript for iTunes forum at iPod Lounge. Copy this script and save it as "sync libraries" to the directory ~/Library/iTunes/Scripts (if you don't already have a Scripts folder there, create it). Relaunch iTunes, and it will be available under the Scripts menu. You can now run this script manually on each computer to update its library against the host. Better yet, use a timed macro (or cron job, which you can set up easily with Cronnix) to launch the script in the wee hours. This assumes that each computer will be turned on when the script executes.
Additional notes:
[robg adds: I haven't tested this one...]
Comments (23)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050215130254540