View Single Post
Old 1st October 2004, 02:17   #4
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Combined with id3com and my scripting/com plugin, the following can be used to export/import ratings and playcounts to/from id3 tags.

-----sendto_id3 import.vbs------

Dim x, id3co

set id3co = CreateObject("ID3Com.ID3ComTag")
x = GetSendToItems
if ubound(x,1) > 0 Then

for each track in x
id3co.link track.filename

'Substitute with your e-mail address or whatever was used to export it
track.rating = id3co.Popularity("") / 51
track.playcount = id3co.Playcount("")
id3co.clear
next

end if
quit

-----sendto_id3 Export.vbs-------

Dim x, id3co

set id3co = CreateObject("ID3Com.ID3ComTag")
x = GetSendToItems
if ubound(x,1) > 0 Then

for each track in x
id3co.link track.filename
if id3co.HasV2Tag then
id3co.Popularity("") = track.rating * 51
id3co.Playcount("") = track.playcount
id3co.SaveV2Tag
end if
id3co.Clear
next

end if
quit

----

warning: if you use the export tool on a file which isnt an mp3, it could possibly corrupt the file. That is why it checks that the v2 tag exists first. So if the v2 tag does not exist, the rating and playcount will not get exported. Feel free to modify this behaviour, but be careful.

Last edited by shaneh; 1st October 2004 at 03:32.
shaneh is offline   Reply With Quote