Tagged everything but does not reflect in ITunes / else

Thanks, I've learned something new there.

Some of your files may contain APE tags which may case a problem. So set up your settings like this.


Load all your files into mp3tag and hit :mt_delete: (only removes the tag types selected in the remove section of this setting) then :mt_save:

Then do your little trick in iTunes. Failing that. Go for dinner and do mine :wink:

EDIT: Hit F3 and enter "%_tag%" HAS "APE"
EDIT: Your method described for updating tags inside iTunes doesn't work on windows 7 x64.


Here is an example for a jscript that you can use to update your library:

var 	ITTrackKindFile	= 1;
var	iTunesApp 	= WScript.CreateObject("iTunes.Application");
var	deletedTracks	= 0;
var	mainLibrary 	= iTunesApp.LibraryPlaylist;
var	tracks 		= mainLibrary.Tracks;
var	alltracks	= tracks.Count;
var	numTracks 	= alltracks;
var	i;

while (numTracks != 1)
{
	var	currTrack = tracks.Item(numTracks);
	WScript.Echo(numTracks + " of " + alltracks);
	// is this a file track?
	if (currTrack.Kind == ITTrackKindFile)
	{
		// yes, does it have an empty location?
		if (currTrack.Location == "")
		{
			// yes, delete it
			currTrack.Delete();
			deletedTracks++;
WScript.Echo("Geloescht " + deletedTracks);
		}
else
{
 currTrack.UpdateInfoFromFile();
 WScript.Echo("Updated " + numTracks);
}
	}
	
	numTracks--;
}

if (deletedTracks > 0)
{
	if (deletedTracks == 1)
	{
		WScript.Echo("Removed 1 dead track.");
	}
	else
	{
		WScript.Echo("Removed " + deletedTracks + " dead tracks.");
	}
}
else
{
	WScript.Echo("No dead tracks were found.");
}

Copy the contents into editor,
Save it to a plain text file with the suffix .js
Right-click on the file and execute it in the command shell (otherwise you will be prompted for every file).
The script will run through your iTunes library and delete references to non-existing files as well as update the data for existing ones, if necessary. It will not add files to the library.
Updating a library of 70000 entries will take hours.

What an active support team!
I found out I could more or less update in ITunes by right click / then bulk edit a stupid tag (comment) and ok. Yet, it seems to work not 100% of occurrences ...
I foudn out I could use MediaMonkey to sync my IPhone (for music). So I kinda give up ITunes!
Yet I am not sure what will happen when I sync the rest...
Thanks for the ideas
Agnes

I assume you mean the link I posted. Haven't done it lately, but my second option, removing an itunes music library and then re-adding music files to the library from scratch should always read the latest version of the tags and art (and use all this in creating the "database" that itunes uses for holding metadata). And I use windows7(64).

Thanks Steve
I have not tested that, I thought of it, but am not sure how to do it. The thing is, if I remove the whole ITunes library I am afraid to lose my Iphone Apps too!
I am also on W7 64
Which file would you then delete?

Agnes

huh? Your itunes library has nothing to do with your iphone apps. Open itunes on your computer. Select ALL music files. right click then select DELETE. Then itunes will ask whether you want to remove from library. You say yes. Then it will ask whether you want to DELETE FILE PERMANENTLY from your harddrive. OF course you want to say NO so it only removes from library only. (Try this with ONE file just so you see how the options work and what it looks like, but when ready, you can do this to ALL files at once).

Once you've deleted all files from library, you'll have an itunes library of no songs. Synch your iphone with this "empty" library.

Then in itunes menu choose FILE > ADD FOLDER TO LIBRARY and choose the top directory of your music library. This will add all those files back, scan for gapless, etc. When it is done, synch your iphone again to pick up the songs again.

This is the brute force way to get itunes to read all the file tags again. There may be easier ways.

NOTE: This should all work fine, but I assume you do have a separate backup of all your music files in case you mess something up. Obviously, you should have a complete backup for other reasons too.

None, create one with the script from post #7 and run it

agree, this is a much better approach than the "brute force" method I outlined.

I have about 50 Smart playlists so that's is a no no.

Yep, if smart playlists based on stats on when played last or ratings, etc. I can see this would be a major headache.

Couldn't get this to work. I copied the codetext into notepad ++ and saved it as a .js in the dropdown box below where I enter this filename. I run it and it opens in dreamweaver. Is there a default way of running this?


Yeah if I can get 'ohrenkinos' method to work to try out then happy days. Don't have to bother deleting anything important.


The trick is not to double-click the file but to use the right-click context menu and then select "Open in command shell".
Double-clicking would be a bad idea anyway as this would (if executed) in a confirmation message box for each file. Rather boring.

Doing as you mentioned and nothing is happening only the command shell is briefly opening (.5 secs roughly) and closing again. Is that all it does normally? See pic of what I'm clicking on.



The starting option seems ok.
To see any error messages, open the command shell on its own,
navigate with the CD commands to the directory where the script is and execute it.
You should then see any messages.
Please note that you have to have to open iTunes as well and leave it open more or less untouched. If you open e.g. the Information dialogue, the script will terminate.
The normal output of the script looks like a countdown
x of y updated
or
deleted x

It could be that you have to install the MS scripting host.

Tried opening the command prompt window dragging the file into the window which puts the path in without typing and hit enter. The file then opens in Dreamweaver as before. I've looked for a MS scripting host but can't seem to find one out there. Think I will stick to my old method. Could you upload your file and maybe see if that works? Thanks.

No, a DOS command shell does not do a lot with dragging and dropping and other fancy mouse stuff. You have to type it in.

So please look for the drvie and path (e.g. in explorer)
Then open the command shell.
To switch to the correct drive type in the drive letter plus the colon, e.g.
D:
for drive d:
then press enter
The command prompt should now show the drive letter.
now have a look at the path. You may copy this part from the address bar in explorer - but only the part after the colon to the end.
Now type in at the command prompt:
cd
leave a blank behind cd, do not press enter.
Open the System menu of the command shell window and select Edit>insert
The path from the clipboard should be pasted.
Now press enter.
You should no see in the command prompt that you have reached the correct path.
Now type in the name of the .js files including .js.
That should do it.
If still Dreamweaver opens then check your Windows installation or refer to a Microsoft page
http://msdn.microsoft.com/de-de/library/ms950396.aspx
to get the scripting host.
As you requested I included my file with all its garbled messages - please replace the txt-extension with js.

Orphan_Killer_and_Updater.txt (940 Bytes)

Thanks. I've got it to work but it's driving me potty trying to get it working like you say.

It was a simple matter of changing the default app to WScript (which I had all along) by right clicking on the file and changing its properties.

Opened the command Prompt and done everything you said.

Press return and a confirmation dialog box comes up like to said only if I double click it which I didn't.

I have no right click context menu for open in command prompt now either after I changed the default application for .js files! Beginning to think this script is cursed.


I've noticed these lines of code in the script:

var currTrack = tracks.Item(numTracks);

WScript.Echo(numTracks + " of " + alltracks);
// is this a file track?
if (currTrack.Kind == ITTrackKindFile)
{

Is it possible to delete the echo lines so that I don't get a pop up on screen but yet do the work? Read somewhere about that echo thing in my search to fix this

EDIT: hallelujah (deleted these lines and no annoying pop ups now)

It took approx 10mins for 10K tracks with no deadtracks found.

var ITTrackKindFile = 1;

var iTunesApp = WScript.CreateObject("iTunes.Application");
var deletedTracks = 0;
var mainLibrary = iTunesApp.LibraryPlaylist;
var tracks = mainLibrary.Tracks;
var alltracks = tracks.Count;
var numTracks = alltracks;
var i;

while (numTracks != 1)
{
var currTrack = tracks.Item(numTracks);
WScript.Echo(numTracks + " of " + alltracks);
// is this a file track?
if (currTrack.Kind == ITTrackKindFile)
{
// yes, does it have an empty location?
if (currTrack.Location == "")
{
// yes, delete it
currTrack.Delete();
deletedTracks++;
WScript.Echo("Geloescht " + deletedTracks);
}
else
{
currTrack.UpdateInfoFromFile();
WScript.Echo("Updated " + numTracks);
}
}

numTracks--;<!--sizec--></span><!--/sizec-->	<!--sizeo:1--><span style="font-size:8pt;line-height:100%"><!--/sizeo-->

}

if (deletedTracks > 0)
{
if (deletedTracks == 1)
{
WScript.Echo("Removed 1 dead track.");
}
else
{
WScript.Echo("Removed " + deletedTracks + " dead tracks.");
}
}
else
{
WScript.Echo("No dead tracks were found.");
}




I can only repeat:
you do not simply "Open" the file (by double-click or by context menu "opne" but you have to open it with the command shell (which is an extra item in the explorer context menu).
I described this in post #17 ...

Anyway, if you are satisfied now.
I added the lines with the ouput as you sometimes do not really know how long it may take, so that some progress indicator could be helpful. If you feel in need to add these lines as your library grows, you know where to do it.
iTunes slows down to almost unusability if the library exceeds some 70000 entries. It then takes almost 15 seconds to delete a single track. It is then quite helpful to see that the script is still alive.

I fully understood that. See the pic I posted above, I don't have that option unfortunately.

Thanks for this script ohrenkino! I encountered this issue after spending hours cleaning up my wifes iTunes library after the update to v11.0 hosed the album art. Your script saved the day! Oh, it also increased the WAF around here...

I registered just to say thanks!