
Update: you will need to install Growl if you do not already have it installed.
Even though iTunes is slightly better about loving NAS drives than it used to be (see my post Mac Attack: Vantec loves America, OS X 10.5 Leopard) life is not perfect. For me, once my Mac loses it's connection to the NAS, such as after waking from sleep mode, iTunes cannot find the original files, even though they are there. The error reads "The song xxx could not be used because the original file could not be found. Would you like to locate it?"
After quite a bit of investigation and trial and error, I'm not sure who's fault it is: it might be the NAS's fault, based on my "solution:" if I list all of the files in the My Music folder on the NAS, iTunes can find them again -- that is, all I need to do is acknowledge their existence and things start working.
My NAS is named "VAULT." Using the Terminal, I executed the following:
ls -R /Volumes/VAULT/My\ Music/

File and folder names streamed by for about 30 seconds, and when it was done, iTunes was able to find the original files again. Great!
Automator It
But, I wasn't satisfied -- I wanted something I could run from within iTunes to fix this when it happens. I decided to fire up Automator and create a little app that would do this for me. Jump to here to download "Find Original Files.app", but to use them you will need to edit the two files within and change some stuff (more on that later). If you'd rather make your own instead of editing my version, here's how:

- Open Automator and create a new, blank workflow
- Optional: Add a Show Growl Notification Action with a handy message, such as Title: "Repairing iTunes Library..." and Description: "This might take a few minutes"
- Add a Run Shell Script Action and add "ls -R (location of your iTunes music folder)" -- example: "ls -R /Volumes/VAULT/My\ Music/"
- Optional: Add a Show Growl Notification Action with a finishing message, such as Title: "Done!" and Description: "Hopefully your iTunes library is fixed."
- File - Save As - Application. Give it a name and Save it in
/Users/(your user here)/Library/iTunes/Scripts. Create that directory if it does not exist.

Unfortunately, iTunes will not let you run Automator apps or workflows from within it, but thanks to Jason Kacmarski's Apple Discussion response to "How do I get automator scripts into iTunes? Very frustrated" I was able to figure it out: create an AppleScript script to launch the Automator app.
- Launch Script Editor
- Add the following, substituting your application name and your folder names where appropriate:
tell application "Finder"
activate
open application file "Find Original Files.app" of folder "Scripts" of folder "iTunes" of folder "Library" of folder "(your user here)" of folder "Users" of startup disk
end tell
3 . Save this to /Users/(your user here)/Library/iTunes/Scripts
Now when you launch iTunes, you should see a little "Script" icon on the menu bar with your application it.

Find Original Files.app

Good luck, and I hope it works for you. Here is a zip file with my version if this little helper app. Unzip the following to /Users/(your user here)/Library/iTunes/Scripts.
find_original_files.zip
Remember: you will need to edit "Find Original Files.app" in Automator and "Find Original Files.scpt" in Script Editor to fix the appropriate directory paths for your particular setup! Also, if you get a Growl error, you will need to install And you might need to install will need to install Growl, too.