PDA

View Full Version : Changing File Locations


capndesign
08-24-2003, 03:07 AM
A few months ago I had moved my iTunes library to an external drive. I left the original files on my system's hard drive until now just in case I had any problems with the external drive (which I have in the past). When I deleted some of the files on my system drive to make space it resulted in most of those files going dead (exclamation point next to the file). I need a way to change the file location of these files without losing my play counts.

I know I could easily solve this by rebuilding my library with the XML file but then I lose my play counts. I also tried to go in and manually change the XML file with an updated location but the iTunes data file still wasn't updated and I didn't want to lose the play counts. I've tried a few of the ways of moving files that preserve the play counts but I can't seem to get them to work.

So, I think the best solution would be to create an applescript that will find all dead files and change a part of the file location so that it points to the new library. The file heirarchy is all the same so I should only have to change everything before the "iTunes:iTunes Library..." section of the file name. I could probably figure out how to do this on my own but I have never tried applescript before and I don't want to blow this. Now the questions.

Is there anything out there that can do this for me now? Are there any scripts that could be modified slightly to do this? I think that Doug Adams' Make Mine 31 Script (http://www.malcolmadams.com/itunes/scripts/scripts07.shtml#makemine31) would be easy to convert but, again, I don't want to screw things up. Any help would be greatly appreciated.

deeg
08-24-2003, 11:28 AM
hi,

in reference to the methods you have tried to reloacte the songs, have you tried changing the location of the itunes music folder on the preferences>advanced ? some people have reported success with this method on the apple boards..

capndesign
08-24-2003, 12:37 PM
Yes, I have. I did that when I initially moved the files.

Doug Adams
08-24-2003, 12:45 PM
Note this about "dead" tracks:

The reason iTunes is alerting you about tracks with a (!) is because it is unable to determine their location (for whatever reason). If iTunes cannot locate the file, an AppleScript will not be able to either.

However, as we have mentioned in the past, if you know your Music folder location and you know that your tracks are in iTunes File Order (Artist folder > Album folder > audio file) you might be able to get a script to attempt to find AWOL files of tracks. Real "dead" tracks, of course, have deleted files.

I have tried to build a script which attempts to locate AWOL files based on the iTunes File Order (you can still detect Artist and Album of AWOL tracks), re-add them, delete old (!) track, but it is extremely quirky (try getting them in all the right playlists, preserve ratings, etc). If there is demand, I will continue work on it, but it's been a difficult road so far.

(Make Mine 31 would probably be of no help whatsoever. It just helps you change the name of the existing file. And actually, since iTunes 4 does a better job with longer filenames, MM31 is pretty much a moot script nowadays.)

capndesign
08-25-2003, 12:48 AM
Originally posted by Doug Adams
I have tried to build a script which attempts to locate AWOL files based on the iTunes File Order (you can still detect Artist and Album of AWOL tracks), re-add them, delete old (!) track, but it is extremely quirky (try getting them in all the right playlists, preserve ratings, etc). If there is demand, I will continue work on it, but it's been a difficult road so far.

Doug, this sounds like the exact thing I need. The thing is that all of the dead tracks are located in both their intended location and their original location, yet iTunes still claims to be unable to find them. If the XML file is any indication, the dead tracks all have the correct file path once inside the iTunes folder. So if there was a script that identified the dead files and was able to change the file location up until it hit "iTunes" in the string then that would most likely work.

Another option would be just to recreate the file names based on the information in the ID3 tags, which were used to create the folders originally.

If you know of any good resources for dealing with strings in iTunes I feel I might be able to piece something together myself. But if this is something you'd like to work on anyway, I'd love your help in any way. Thanks.

Doug Adams
08-25-2003, 08:07 AM
I will investigate a script solution further.

In the meantime, have you Repaired Permissions? Also, I had luck "finding" my disappearing files (that hadn't really disappeared) by making sure the default application of my mp3s and aacs was indeed iTunes (set the Open With in a few files to iTunes). I haven't missed a track since.

Doug Adams
08-25-2003, 08:52 PM
iTunes Track CPR (http://www.malcolmadams.com/itunes/scripts/scripts07.shtml#itunestrackcpr) will examine all tracks; if any tracks are (!), an attempt will be made to locate a file in the Music folder providing the Music folder is organized by Artist > Album > files. If a file is located it will be added to iTunes, put into the playlists the orginal was in, and all remnants of the original (!) track will be deleted.

Also, most tag data will be rescued (you will lose play count and obviously a new Date Added will be generated).

Additionally, a text file will be generated that tells what tracks were found (if any) and what tracks are considered MIA (which doesn't necessarily mean they don't exist; they just weren't found in the Music ? > Artist ? > Album ?).

Feedback via email appreciated!