Windows – Exporting all file locations that could not be found on iTunes

itunesmusicscriptwindows

I'm running Windows 7 64 bit and am using iTunes. I previously had an issue where when iTunes organized my media library (after transferring all my music over), the file names were auto-truncated to 40 characters. This effectively broke a large portion of my library.

To see all the songs that were broken I created a smart playlist of "dead" songs and exported that playlist information. Unfortunately, the dead locations did not get exported when I chose File -> Export Playlist, only the other metadata was exported. This is strange because when I actually select Get Info on the song, I can see the file path it is looking for.

Is there some way to get this information exported? I'm trying to write a script to auto-rename the files it finds to the correct (longer) file names.

Edit:

Here is an example:

Let's say I have a song that is broken in iTunes (the file path is incorrect). In iTunes this appears with the correct metadata. I can check the metadata by right clicking on the song in question and selecting Get Info.

My song structure looks like this:

Artist: DJ Rashad
Song: Last Winter
Album: Double Cup
Genre: Footwork
Location: C:\My Music\iTunes\DJ Rashad\Double Cup\DJ Rashad - Last Winter.mp3

In this case the Location attribute is incorrect, which is fine. But I still need this data when I export the information about the track. So I drag this track into its own playlist and export the information via File -> Export Playlist. I expect to see the structure above but instead what appears in the corresponding file is the following:

Artist: DJ Rashad
Song: Last Winter
Album: Double Cup
Genre: Footwork
Location:

Since iTunes does not find the location, it exports an empty location. Since I am writing a script to correct some broken paths, I do not want an empty location. I want the last known location of the file (the one that is displayed when viewing Get Info). How can I export the complete information under the Location attribute?

Best Answer

suggest you go a different path.

first remove all the broken links in itunes Can I easily view all songs that iTunes can't locate in Finder?

then drag&drop your complete lib back in itunes (there wont be duplicates, if you drag files that are already linked/imported.)

done