• About Me
  • TV Marathons
    • Doctor Who
    • Star Trek TOS
    • Star Trek TAS
    • Star Trek TNG
    • Blake’s 7
    • Red Dwarf
    • Star Trek Continues
    • Chef!
  • All My Vinyl
  • Favorites
  • Archives
  • Contact Me
Recent Posts
  • Bounty May 8, 2025
  • Breakdown May 7, 2025
  • Project Avalon May 6, 2025
  • Duel May 5, 2025
  • Yes – 90125 May 5, 2025
Skip to content
A Cup of JoeA Cup of Joe

Observations, rants, and musings by Joe Siegler.

  • About Me
  • TV Marathons
    • Doctor Who
    • Star Trek TOS
    • Star Trek TAS
    • Star Trek TNG
    • Blake’s 7
    • Red Dwarf
    • Star Trek Continues
    • Chef!
  • All My Vinyl
  • Favorites
  • Archives
  • Contact Me
    • Computers

How to change the play count number in iTunes

  • byJoe Siegler
  • Posted on November 15, 2010December 14, 2022
  • 2 minute read
0
0
0

UPDATE: This does not seem to work in Windows 8.  If anyone has an idea how to make this work in Windows 8, let me know.  Tkx.

UPDATE 2: This did NOT work for me in Win8/64bit using iTunes 10.7.  However, since iTunes 11 came out, it works again with no addtl changes.  Can’t explain that.

It’s been awhile since I posted some sort of tech/computer thing on this blog, but when I was using this little tip myself today, I thought I’d share it.  I can’t remember how I happened upon this, but I wanted to pass on the info.

NOTE: This is for Windows.  I have no idea how you’d do this on a Mac.

One thing I’ve noticed about iTunes is that not everything is easily changeable.  For instance the play counts.  There’s been times where I’ve accidentally deleted an album with playcounts, and wanted to get back what I had.  Or I’ve imported a new version of an album, and I wanted to transfer over my playcounts, but you can’t do that in iTunes itself without resorting to playing the track the number of times you want, and shifting the slider bar to the last two seconds so the playcount gets increased.  Those kind of tricks aren’t needed anymore.  Just follow these steps.

Open Notepad and put the following text in it:

Dim iTunesApp, currTrack, newPlayCount
 Dim prompt, title, defaultValue

 Set iTunesApp = WScript.CreateObject("iTunes.Application")
 Set currTrack = iTunesApp.CurrentTrack

 prompt = "New playcount:"
 title = currTrack.Artist & " - " & currTrack.Name
 defaultValue = currTrack.PlayedCount

 newPlayCount = InputBox (prompt, title, defaultValue)

 If IsNumeric(newPlayCount) Then
 If newPlayCount >= 0 Then
 If Len(newPlayCount) > 0 Then
 currTrack.PlayedCount = newPlayCount
 End If
 End If
 End If

Save the file as “SetPlayCount.vbs”, putting it in some easily accessible location.  When you double click on it, a box will pop up, asking you what you want the playcount to be.

One caveat, it only works on one song at a time.  It will be the “selected” song.  Whether it’s playing or not, it will only edit the one track that you have highlighted in iTunes.  If iTunes isn’t running, or you don’t have anything selected (like you just started iTunes), it will error as well.

It’s not perfect, but it is useful if you want to change the playcount of an individual track in iTunes.

Join the Conversation
  1. Ian Sang says:
    August 12, 2011 at 6:41 AM

    it works perfect! thanks for solving my problem!
    Ive been wondering how i can change the play counts for a long time and ill be using this method often!

  2. Ryan says:
    August 16, 2011 at 10:42 PM

    Nice iTunes vbs trick! I hate having duplicate songs with varying play counts and this is a good way of combining the play counts and deleting one.

  3. David says:
    October 17, 2011 at 12:27 PM

    Its great thanks a lot!

  4. Coco says:
    November 29, 2011 at 9:58 AM

    not working for me… Error is:

    Line: 8
    Char: 2
    Error: Object required
    Code: 800A01A8
    Source: Microsoft VBScript runtime error

    I’m running Windows 7

  5. sparty says:
    December 12, 2011 at 8:01 PM

    Works great, thanks alot, much easier than the other method.
    Would it be possible to edit this file to alter the ‘Last Played’ info?

  6. ayush says:
    January 28, 2012 at 9:02 AM

    it is very helpful…

  7. Rob says:
    March 7, 2012 at 12:23 AM

    Wow! It worked!

  8. Dave says:
    March 13, 2012 at 5:52 PM

    It only works for me when the song is actually playing. Otherwise it changes the last song played/give an error message.

    Great tool though – had some well played songs which appeared to have their playcount go up 10x, messing up some smart playlists.

  9. kiwi32 says:
    April 2, 2012 at 2:13 PM

    Thank you so much ! Great little tool works perfectly !

  10. jt says:
    June 7, 2012 at 8:54 AM

    Great!! I was tinkering with the iTunes.xml file, modifying playcount but everytime I went back to iTunes, the count never changed and the .xml file reverted. Odd. Searching Google, I came across this tip and it works. THANKS so much!

    I did get the error message like the above posts, but I played the track and then tried the script and that’s when it worked.

  11. Thomas says:
    June 8, 2012 at 11:23 PM

    Thanks a lot! it works for me !

  12. Nicolas says:
    June 22, 2012 at 8:34 PM

    Amazing!!! I’ve been looking for this for so many time. THANK YOU!!!!

    For me, the song has to play… only selected won’t do it. Minor detail. ;-)

  13. Alex says:
    June 26, 2012 at 12:12 PM

    Oh my gosh. I have been searching for something like this for so long. Thank you so much! Works Perfectly!

  14. Marco says:
    July 4, 2012 at 11:58 PM

    Wow you’re awesome! Thanks so much!

  15. Shanomo says:
    July 13, 2012 at 10:33 PM

    This works perfectly, when I update an inferior quality song with a new version I can now keep the recorded play counts. Many thanks!

  16. Kelly says:
    July 25, 2012 at 12:03 AM

    this is wonderful. thanks so much!

  17. Kathy says:
    August 9, 2012 at 3:10 AM

    OMG THANK YOU!!!!
    This helped so much

  18. Daniel says:
    August 23, 2012 at 11:36 PM

    8/24/2012 – It works! Just follow the instructions ^_^

  19. Diego says:
    August 24, 2012 at 8:35 AM

    OMG this is Awesome! Thanks for sharing!

  20. Erica says:
    August 27, 2012 at 2:45 AM

    It works great! Thanks!

  21. stan says:
    September 16, 2012 at 6:04 PM

    Works like a charm! In my case, iTunes 10.7 on Windows 7, it only works with the song that is playing.

  22. Frances says:
    October 2, 2012 at 1:24 PM

    When I double click it just opens back in notepad, what have I done wrong?

  23. DJ says:
    October 2, 2012 at 2:39 PM

    Thank you so very much! I have a kind of OCD about my play count, and the past few nights, I’ve been falling asleep with music on repeat. I could take away the extra plays quite easily with this. Thanks again!

  24. Ravensyn says:
    November 6, 2012 at 8:02 PM

    Solved a problem that was really getting to me! Thank-you very much.

  25. kC says:
    November 24, 2012 at 8:47 PM

    It works just fine in Windows 8.
    Just use notepad and choose to save the file as ‘All files’ instead of ‘.txt’, and have it saved on the desktop.

  26. furbian says:
    December 2, 2012 at 4:47 PM

    Thanks for that! So simple yet effective.

  27. LinuXtreme says:
    December 3, 2012 at 7:09 PM

    Great tip! I had tried changing the xml file but, like JT (June 7) said, no luck there.

    As mentioned by so many others, when I tried simply selecting a song in iTunes I got the error but having a track playing enabled the tool to work its magic.

    I’m notoriously anal about my playcount matching for an entire album. I recently re-ripped one of my CD’s so this was a welcome fix hack! Now I can re-rip the rest of my collection with no regret…

  28. Scott says:
    December 3, 2012 at 10:22 PM

    Thank you! i had 14 too many plays on 12 songs so this helped a lot!

  29. jerkyhunter says:
    December 4, 2012 at 6:53 PM

    If you are ever in, say, jail and need bail money? E-mail me. I owe ya. P: thankyouthankyouthankyouthankyouthankyou

  30. Jonathan Chapman says:
    December 25, 2012 at 5:29 PM

    It says can’t create object name itunes application seems I’m the only one it hasn’t worked for

  31. Ryan says:
    January 30, 2013 at 9:37 PM

    If you are still having errors with Windows 8 make sure you are running wscript as Administrator. Put the code below at the beginning of the script. At the end of the whole script add a fourth “End If” statement.

    Set WshShell = WScript.CreateObject(“WScript.Shell”)
    If WScript.Arguments.length = 0 Then
    Set ObjShell = CreateObject(“Shell.Application”)
    ObjShell.ShellExecute “wscript.exe”, “””” & _
    WScript.ScriptFullName & “””” &_
    ” RunAsAdministrator”, , “runas”, 1
    Else

  32. Kevin says:
    March 4, 2013 at 12:24 AM

    Works perfectly! Win8 x64 iTunes 11.0.1.12

  33. Aurora says:
    March 8, 2013 at 6:38 PM

    This is great! It’s been very helpful changing my play count!

  34. FourLions says:
    April 12, 2013 at 10:52 PM

    This works on me using Win8 Pro 64-bit, using iTunes 10.7.0.21
    :D

  35. Michael says:
    May 28, 2013 at 12:25 AM

    As someone that is extremely obsessive with their iTunes library, this helped me out EXTREMELY when I got a new computer and lost my entire iTunes library. Massive thanks!

  36. David says:
    August 30, 2013 at 1:32 AM

    OMG THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

  37. Edo says:
    October 23, 2013 at 2:26 AM

    It’s a really great little programme! Very helpful.

    But ever since I updated to iTunes 11.1.1.11 it doesn’t work anymore :(… I already altered my SetPlayCount with the extra couple of lines Ryan mentioned on January 30th. I still get the following warning:

    It says it can’t find iTunes.Application
    Code: 80020009
    Source: WScript.CreateObject

  38. PotatoMan says:
    October 26, 2013 at 9:53 PM

    Wow it actually worked

  39. Star says:
    December 20, 2013 at 4:56 AM

    It didn’t work for me, said the track couldn’t be modified.

  40. ShortKake says:
    January 3, 2014 at 12:43 AM

    How can I make this work on my Macbook???

  41. benvoliothefirst says:
    February 18, 2014 at 10:18 PM

    Thanks so much, does exactly what it says on the tin. Perfect little applet that does something that should be built into iTunes to begin with.

  42. solomon says:
    March 16, 2014 at 7:54 AM

    Thank you man. It worked.

  43. KnifeFight says:
    March 26, 2014 at 7:41 PM

    This is f’ing awesome! THANK YOU!!!

  44. Homa says:
    May 12, 2014 at 12:14 PM

    Thaks sooooo muuuch!! Awsome tip:bd

  45. Kevin says:
    November 27, 2014 at 7:24 PM

    Thanks a lot! The script works like charm with my iTune v12.0.1.26.

  46. Darryl Edwards says:
    December 19, 2015 at 11:07 AM

    Works absolutely great, just follow the instructions exactly. I made the mistake of creating a new notepad file first, and then trying to save as SetPlayCount.vbs which didn’t work. You have to open NotePad, paste the text in and then save as SetPlayCount.vbs (select “all files” in the “Save as type” drop down.

  47. Darryl Edwards says:
    December 19, 2015 at 11:17 AM

    In addition to my last comment, I actually prefer this code which lets you change the current iTunes track selected, rather than having to change the track that’s currently playing in iTunes. This way, I can listen to my iTunes whilst still editing Play Counts :). See the code below:

    Dim iTunesApp, selectedTracks, newPlayCount
    Dim prompt, title, defaultValue

    Set iTunesApp = WScript.CreateObject(“iTunes.Application”)
    Set selectedTracks = iTunesApp.SelectedTracks

    prompt = “New playcount:”

    For Each IITTrack In selectedTracks
    title = IITTrack.Artist & ” – ” & IITTrack.Name
    defaultValue = IITTrack.PlayedCount
    newPlayCount = InputBox (prompt, title, defaultValue)

    ‘MsgBox(“NewPlayCount = ” & newPlayCount)

    If Len(newPlayCount) > 0 Then
    If IsNumeric(newPlayCount) Then
    If newPlayCount >= 0 Then
    IITTrack.PlayedCount = newPlayCount
    End If
    End If
    Else
    Exit For
    End If
    Next

  48. Michael S. says:
    April 23, 2016 at 11:55 PM

    Love it! Though time consuming I was able to change the play count for over 700 songs. I’m going to play with the code in VB6 and see if I can streamline and accelerate the process in one shot by loading in a text file containing the desired data.

Leave a Reply

Your email address will not be published. Required fields are marked *

Donate

Why is this here?

Me


Follow @JoeSiegler
Archives by Date
Featured Posts
  • History of Duke Nukem Part I
    • April 19, 2011
  • My Story of 3D Realms / Apogee Part VII
    • November 2, 2020
  • My Story of 3D Realms / Apogee Part III
    • November 2, 2020
Me


Follow @JoeSiegler
Donate
Why am I asking? I don't have any advertisements on this site anymore. I used to, but removed them. You can read why here. Please consider donating.

Twitter Feed
Archives
Created with Wordpress. Using ShadeGarden Theme by Dany Duchaine | Mastodon.
Swim, Swim, Hungry!