run itunes from network storage

thanks to the author of this article at macosxhints, I can now share my music from a network drive (NAS)

There are a lot of tips here regarding using iTunes and a networked music folder. The biggest issue is iTunes changing the library’s path to a default (local) path every time it is started if you forgot to mount the networked music drive first. After trying a few tricks and scripts, I noticed something really simple: when you have an alias to a resource on a network drive and click it while the drive is not mounted, OS X starts to search simply mounts the drive. So all I had to do was:
Go to /Applications and make an alias of iTunes.
Drop the newly-created alias on the network drive.
Copy the alias from the networked machine back to my dock. (Remove the original iTunes icon from the dock to avoid confusion!)
That’s it! No script needed. If the drive is mounted, it just opens iTunes. If it’s not mounted but mountable, it mounts and then starts iTunes, which will find all its files. And if the drive is not mountable (e.g. turned off), you simply get nothing (except some sort of dialog warning), which is exactly the behaviour I want.