Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Command or script to clean out library list?

Several months ago I upgraded both my motherboard and operating system (to Win7). I used Apple's recommendation on migrating all my iTunes files, and everything seemed to go well. I have a large music collection of more than a thousand files on my PC. I've set preferences in iTunes so that I manually manage everything; there is no auto syncing of any kind.


Although iTunes is of course installed on the C drive, all music files are in locations on a larger but internal D drive. About 600 of those song files in iTunes have a group name that allows me to select them and copy to my iPhone, which I listen to quite a lot.


Couple of weeks ago I logged into my PC and noticed the iTunes song list had duplicate entries for almost every song. At first I thought maybe the setting for copying music files to an iTunes library/folder on the C drive might have somehow gotten turned on. But no it was still off. I started doing "Get info" on dupes and sure enough they had all been copied to a new iTunes library and subfolder on the C drive. Don't really know or care how this could happen at this point. But I would like to know if there is a command or script I can run that will look through the iTunes song list, find each one with a path to the C drive iTunes folder, and delete that song entry. Tips?

Windows 7

Posted on Jan 11, 2014 2:05 PM

Reply
7 replies

Jan 12, 2014 12:51 AM in response to okieseeker

Ah, I didn't realise you'd deleted the tracks already...


To identify the broken links in your library create this set of playlists:


Lost & Found playlists

Create a playlist called Found, select everything in Music and drag it into the Found playlist. Create a smart playlist called Lost matching All the rules Playlist is Music and Playlist is not Found. Your lost tracks will be in this playlist. To clean up open the Lost playlist, press CTRL+A to select all and then SHIFT+DELETE to delete from the playlist and the library.


Or use iTunes Folder Watch and enable its option to check for dead tracks on startup.




Had you not deleted the the physical files Unconsolidated would have created a similar list to Lost. DeDuper would have been able to both delete the duplicates but merge any ratings, play counts or playlist membership. For reference when a file isn't where iTunes expects it to be it will report the location as an empty string to any script. Get Info will show the last known path in the form file://localhost/<Path>.


tt2

Command or script to clean out library list?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.