original file could not be found

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/

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:

Automator for finding iTunes original files

  1. Open Automator and create a new, blank workflow
  2. 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"
  3. Add a Run Shell Script Action and add "ls -R (location of your iTunes music folder)" -- example: "ls -R /Volumes/VAULT/My\ Music/"
  4. Optional: Add a Show Growl Notification Action with a finishing message, such as Title: "Done!" and Description: "Hopefully your iTunes library is fixed."
  5. 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.

iTunes Scripts folder location

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.

  1. Launch Script Editor
  2. 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.

iTunes script menu

Find Original Files.app

Find Original Files.app Running

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.

7 Responses to “Mac Attack: Making iTunes Find Those Original Files (Especially on a NAS)”

  1. Matt Says:

    Hi,

    I’m trying to use this method to locate my entire itunes library after moving from pc to mac. I have downloaded the “find original files” but when i try to open it in the error message “The action “Show Growl Notification” could not be loaded because it could not be located.” is displayed. can you offer any assistance? Thanks

  2. Joe Says:

    Hi Matt,

    You need to install the Growl notification system, which many 3rd-party Mac applications use, but for some reason Apple does not pre-install. Let me know if you have any issues after that.

  3. Gareth Says:

    Thanks for this - I would never have come up with something as simple as running “ls -R” to get the files picked up. In my case, I had to write an automator script that would run before launching iTunes - running “ls -R” once iTunes had already complained about the files didn’t work.

  4. Mary Says:

    What is the application “Finder”? And what do we put instead?

  5. Mary Says:

    What is the application “Finder”? And what do we put instead?

  6. Joe Says:

    Mary –

    “Finder” literally means the Finder application that constantly runs on Mac OS X.

    Finder Image

    No need to put anything else instead… as long as you are running a Mac.

  7. Steven Fisher Says:

    THANK YOU SO SO SO SO SO MUCH!!

    I had been having such a nightmare trying to get my NAS working!

    After following your very clear instructions I can solve the non playback issue in about 20 seconds!

    THANK YOU!!

Leave a Reply