11002 Views 9 Replies Latest reply: Jan 7, 2007 1:51 AM by chris_parker_uk
The only way I know of is to edit the XML file iTunes generates. In the iTunes Music folder is a file called "iTunes Music Library.xml". It lists each and every song, its tags, play count, etc. You could manually edit this for each song.
If you choose to do so, becareful not to change the format of the file or anything.
I tried editing "iTunes Music Library.xml". Here is what I did:
(1) Quit iTunes.
(2) Open "iTunes Music Library.xml" in BBEdit.
(3) Search for the song name of interest.
(4) Change the number in:
to the desired number.
Every time I did this, iTunes would reset the number back to its original value after it is launched.
Am I doing something wrong?
How can I
manually edit play counts?
Any tips would be greatly appreciated.
You can use AppleScript. I whipped up a quick one that will do what you want. Just copy this text and paste it into the Script Editor in the AppleScript folder in your Applications folder:
<pre class="command">tell application "iTunes"
set sel to selection
repeat with t in sel
set trackname to the name of t
set dialog_answers to display dialog "Enter a new play count for " & trackname & ":" default answer ""
set newcount to text returned of dialog_answers as integer
if button returned of dialog_answers is "OK" then
set played count of t to newcount
end tell</pre>Look in the Library folder in your account's home. There might be an iTunes folder. If there is, see if there's a "Scripts" folder inside it. If there is, save your script there, with a name like "Change Play Count". Choose "script" as the format. It'll show up in a new menu with a little script icon.
You should be able to select a track or tracks in iTunes and use this script to change the play counts. It's kind of a quick hack, so there's not much in the way of error checking, and if you hit the "Cancel" button, it just stops, but it'll get you started...
I thought for sure that would work - but I just tried
it and it doesn't. Don't know why.
I seem to remember reading, and a quick Google search kind of confirms, that the XML file is re-written by iTunes when it closes, using the information from the other binary database file.
Also, there's this procedure listed in Apple's support site that tells how to use the XML file to recreate your iTunes library. You might be able to use that procedure to get around iTunes re-writing the XML file. Just make sure you've backed up your other preferences, in case it doesn't work. (I didn't feel brave enough to try it).
Note that iTunes itself does not use the library.xml file.
This is generated by iTunes for use by other programs.
Editing it will not affect iTunes in the slightest.
Being on Windows and not having the luxury of scripts
In your particular case I do the following.
1) I move the original/old files to a different location on the Hard Drive.
2) Next I run Itunes and try to play those original files, but (obviously:) they're not there and itunes tells me that the source files cannot be found do I want to locate them..
3) It's at this point that I point Itunes to the new remastered version on the HDD and the play count/rating etc is the same just links to the better version..
Hope that helps..
PS - I'm still on the look out for a way to manually or auto update the Play Count (without syncing everything else)