What it does: StarCatcher is a Java command-line program that extracts all the ratings from an iTunes program.
How to use: With a JRE installed, you run this line from the command line ("java StarCatcher") from the directory in which the program resides. You will be prompted to open a file through a pop-up window--you need to find iTune's "iTunes Music Library.xml" file. Apple usually places this in the user's music (or "My Music") folder.
Please noe that even though this is a command line program, you need to have a graphical interface present, i.e. Windows. You also may need to set the Java path correct in your OS*.
Depending on how many songs you've given ratings to, the program may take a minute or two to complete. The output is a file called "StarRatings.txt." The output will look something like this. I haven't tried this program on an Apple Mac yet, but it should work in theory, given that its is Java.
Download program here
Download source code here
*In Windows 7, you go control panel->Systems and Security->System--> remote settings-->Advanced-->Environment variables->System variables--> Look for, click on PATH-->Edit--> append ";C:\Program Files (x86)\Java\jre6\bin" at the end of the line. Restart computer.
See here for installation on Windows XP.