But, I also wanted to carry 1 or 2 GB of MP3s with me when I was not at home. So I created a smaller "LocalMusic" folder in /Users/Shared/. I put it there so any logged-in user could play music from the same library. Then all I needed was a way to change the soft link "Music" in my ~/home directory to point to one or the other of the two "Music" folders.
So I wrote an Applescript that:
- Checks to see if iTunes is running;
- Gets the name of the current ~/home folder (so it works for all users);
- Determines if the server share (or Firewire drive) is mounted;
- Gets the correct path to the mountpoint (different for each logged-in user in the case of FUS); and
- Makes a new soft link in the current users' ~/home directory.
Enter this in Script Editor:
tell application "System Events"
if not (exists application process "iTunes") then
set short_name to do shell script ("id -un")
tell application "Finder"
if (exists folder "MusicShare:ServerMusic:") then
set the_path to POSIX path of file "MusicShare:ServerMusic:"
do shell script "ln -fhs '" & the_path & ¬
"' '/Users/" & short_name & "/Music'"
else
do shell script ¬
"ln -fhs '/Users/Shared/LocalMusic/' '/Users/" & ¬
short_name & "/Music'"
end if
end tell
end if
end tell
tell application "iTunes" to activate
Save the script as an Application called iTunes Script.app, paste an icon on it, and use the script in your Dock instead of iTunes. Don't forget to correct the permissions for both the script and the Music folders.
Now when I launch iTunes, the script checks to see if my server share is mounted. If so, iTunes opens my entire server music library. If not, iTunes opens my current favorites local music library. If iTunes is already running, it just brings iTunes to the foreground.
TIP: Plug your new Mac Mini into your home stereo system. Move your Music folder into your ~/Public folder and make a soft link back to ~/home. Then turn on Personal File Sharing. Now your home stereo and home office laptop can share the same music library.

