An option within the library rescan dropdown to "Re-scan all Unknown" would be nice too. Is that a separate idea, boss?
Yeah, you won't find a cross-platform way, short of directly manipulating the iTunes database files (XML format I think), and heaven knows what iTunes would think of you doing that if it happened to be open at the time.
You have objTrack.Delete, and objLibrary.AddFile(...) that could be of immense use here. objTrack.Location can be used to determine if a file has been removed from the library (if(objTrack.Location == "")).
The documentation you want is the "iTunes COM for Windows SDK" from developer.apple.com - I assume there is something similar for OS X.
For OS/X you have good old AppleScipt - not sure how you use it for this job though, but there must be some form of documentation somewhere. The iTunes SDK documentation is probably the best place to start.
By the way, here's a VBS version which is much nicer as it gives you some feedback of what it's doing:
Dim Arg, Str
If Not LCase( Right( WScript.FullName, 12 ) ) = "\cscript.exe" Then
For Each Arg In WScript.Arguments
If InStr( Arg, " " ) Then Arg = """" & Arg & """"
Str = Str & " " & Arg
CreateObject( "WScript.Shell" ).Run "cscript //nologo """ & WScript.ScriptFullName & """" & Str
Set objApp = CreateObject("iTunes.Application")
Set objLibrary = objApp.LibraryPlaylist
Set colTracks = objLibrary.Tracks
For Each objTrack in colTracks
WScript.Echo objTrack.Artist & ": " & objTrack.Album & " - " & objTrack.Name
var iTunesApp = WScript.CreateObject("iTunes.Application");
var tracks = iTunesApp.LibraryPlaylist.Tracks;
var numTracks = tracks.Count;
for (i = 1; i <= numTracks; i++)
var currTrack = tracks.Item(i);
An API would be OK, or maybe a way to export the database in a format that can be easily parsed and inserted into a MySQL (or similar) database would be acceptable. Even just a CSV export of the entire database would do...
A simple database lookup would be fastest. Record details of all the tracks and their genres, along with all the other details about them, and then you just look up from that database the tracks / albums that require assessing against the change you made. Maybe with a "reassess all" option for if you have made changes outside of bliss.
I'm not surprised my system is running slow with the number of fpcalc processes running... 100% CPU usage, yet each one only gets a few percent of it. Being able to limit the number of fpcalc processes to a number suitable for your processing power (or lack of in my case) would be a big help.
Hell yeah, this is so needed. I don't want 32 different flavours of pop, just pop. So being able to say "this and this and this are all pop" would be wonderful. It could, when saying that the detected (from online sources) genre isn't allowed, ask you which genre family it belongs to, and then all others of that same genre will be tagged as the right genre family instead.