AppleScripts – Edit your iTunes Play Count

You might ask, why would I ever need to edit the play count of a song? That’s a valid question and this function is probably reserved for the more anal iTunes user but let me give you an example. Sometimes I begin listening to an artist through a ‘Best of’ Album. After a while I realise that I LOVE them and I decide to graduate to their studio albums. Now it annoys me to no end that the songs that I have been listening to on repeat on the Best of albums have no plays on the actual studio albums.

Yes, I’m that pathetic.

If you’re my kinda guy/gal here’s how you add a little script to iTunes to edit the play count of a song. I found the script on the Apple Forums so I thought I would share it here.

*If you’re on a Windows machine scroll to the bottom of this post for more information.

** If you’re looking to change the play count of multiple tracks to one value I customised the script. You’ll find it at the bottom of this post as well.

(And… If you want more of this stuff. Head over to Doug – he’s the king of iTunes applescripts. He probably has a script you didn’t know you wanted. He’s active on twitter if you’re the type…)

1. Download the following file:

 

It should look like this:

AppleScripts-Chikaboo_Designs-2

2. Now save it in the follow directory:

Users > [User] > Library > iTunes > Scripts (create this folder if it doesn’t already exist)

**The name of the file is what will appear in your iTunes services Menu, I named mine ‘Change Play Count’ as you can see from the file name.

AppleScripts-Chikaboo_Designs-3

(Untitled is the name of my hard drive and chikaboo is the name of my user)

**If you can’t find your Library folder, when you’re in finder select ‘Go’ in the menu bar and hold down the alt/option key at the same time, it will appear in the list of folders.

3. Ta dah, you will now see the option in the scripts menu of iTunes! Just select a song and type in the number

AppleScripts-Chikaboo_Designs-4

AppleScripts-Chikaboo_Designs-5

***** UPDATE 21/05/2018 ******

If you’re on a Windows machine, someone contacted me with an application they made: https://github.com/CDEngineer/iTunesDataEditor/releases. Some instructions from the creator:

In a nutshell, you create a playlist with the songs you want to edit, fire this tool, select that playlist and then you have a grid with all the songs, double click the play count and change it, when you press ENTER it is saved to the iTunes library.

Thank you Mistico!

********************************

***** UPDATE 06/11/2018 ******

Someone requested the the script make it possible for you to select multiple tracks and change their play count value at one go. I have adapted the below script for that purpose. The process for installing it is the same as above.

********************************

35 Comments

Join the discussion and tell us your opinion.

Benreply
16th February 2017 at 3:57 pm

Hi Natasha, I tried to add this script but it’s giving me “A command name can’t go after this identifier.” With “played count” in the fourth last line highlighted. Any Help would be appreciated. Thanks!

Natasha Natarajanreply
16th February 2017 at 4:05 pm
– In reply to: Ben

Hey there!

I have changed the tutorial slightly and included a downloadable file of the script. Here it is: http://www.chikaboo-designs.com/wp-content/uploads/2016/01/Change-Play-Count.zip

Let me know if that works!

Benreply
16th February 2017 at 4:10 pm
– In reply to: Natasha Natarajan

That worked perfectly! Thanks for the quick response and all the help. Really appreciate it!

Natasha Natarajanreply
16th February 2017 at 4:11 pm
– In reply to: Ben

No worries at all. I’m so happy that someone actually wants to change their play count and is reading this article – this is the best thing that’s happened to me all day. Hah. Have a good one!

Ben
16th February 2017 at 4:31 pm
– In reply to: Natasha Natarajan

I’ve been replacing older albums with remastered albums or deluxe editions so it was silly to start from “0” on all the albums I’ve been replacing. This is a great alternative to queuing the song 200x and skipping to the end 200x 🙂 I’m glad I found this post.

iereply
11th March 2017 at 4:55 am

This script was a godsend – thanks so much!

Natashareply
11th March 2017 at 3:05 pm
– In reply to: ie

I’m glad I could help!.. but mostly I’m glad I am not the only one needing to change my play count!!

Mikereply
27th May 2017 at 7:29 pm

Im confused on how to save it in itunes?

Natashareply
28th May 2017 at 8:16 pm
– In reply to: Mike

Hi Mike,
You should save it in this directory:
Users > [Username] > Library > iTunes > Scripts (create the Scripts folder if it doesn’t already exist)
Does that help?

Pedroreply
3rd July 2017 at 11:07 am

As a person the likes to own and organise my music in the era of Spotify & co I´m so glad to finally find a script like yours.
Thank you very much

Natashareply
3rd July 2017 at 12:47 pm
– In reply to: Pedro

Pedro!! You made my day! If you ever want to give me some iTunes tips get in touch!

Jasonreply
19th August 2017 at 6:29 am

Thanks, Natasha! This works just as intended on macOS 10.12.6 running iTunes 12.6.2.20. Cheers!

Aranreply
1st October 2017 at 2:04 am

Worked for me too! Exactly what I needed to do. I had someone send me a song or two of an album and liking it a hell of a lot, I decided to buy the official album off iTunes. I deleted my downloaded ones and re-downloaded right off iTunes and had to set up my play count again. I’m definitely one of those “anal” iTunes people haha

Édioreply
6th October 2017 at 3:21 pm

I’m so happy to know I’m not the only one who worries about play counts! Always work on it when I have a song in “XXXX 0 single” album and then the actual album is released.
I found this script on the Apple forum as well, but I couldn’t manage to make it work. With your tutorial, there was no way to miss it. Thank you for this! You made my day 🙂

Mattreply
19th January 2018 at 9:07 am

Thank you so much Natasha! iTunes Match managed to screw up one of my favourite albums, and the only way to fix the problem was to reimport the CD – which I expected would mean losing my play count data for these tracks, which would flow on to ruin several smart playlists I have which rely on play count data. Your script saved me 🙂 Once again, thank you so much!

Dave Dayreply
6th February 2018 at 2:53 pm

Hi, Thank you for this. Unfortunately after modifying the play count, as soon as iTunes syncs to the cloud it will change it back to it’s original count. I wonder if it’s because I have an Apple Music subscription?

Natashareply
6th February 2018 at 3:00 pm
– In reply to: Dave Day

Hi Dave,
That’s really strange. I haven’t experienced any problems like that so I imagine it is because of your Apple Music Subscription. That seems weird thought because you would think your library play count would just be added to the cloud. I will do some googling and see if I come up with anything. I briefly read that it might take some time. Maybe a couple of hours?

Dave Dayreply
6th February 2018 at 3:33 pm
– In reply to: Natasha

Hi Natasha, as soon as iTunes syncs it reverts to the previous count. It’s as if Apple has a ‘the cloud is the truth’ policy. 🙂

Natashareply
6th February 2018 at 3:45 pm
– In reply to: Dave Day

Dave, I hate to say it but I think the cloud is slowly trying to ruin and take over our lives… 😬

Kevinreply
3rd March 2018 at 4:15 pm

I know this has been a while.. This seems like an amazing tool! By any chance, do you have a Windows version of this, or know of something similar? I am in a similar boat as you and some of the other posters, in terms of needing to adjust playcounts when Remasters are taken into account. If I have heard every song in the Van Halen album ‘1984’ over 300 times each, it makes no sense for me to start over at 0 if I am updating!

Natashareply
3rd March 2018 at 4:56 pm
– In reply to: Kevin

Hi Kevin! I love when people take interest in this blog post, makes me feel less alone in my anal iTunes library sorting. I think the way you’re going to have to do this is by editing your iTunes library xml file (some information on it here: https://support.apple.com/en-gb/HT201610). Open it with notepad or another simple text editor, I don’t remember what the default one is on Windows anymore. Then find the songs and manually change the play count. That’s the only way I could think of. Let me know if it works.

Misticoreply
9th May 2018 at 6:19 am
– In reply to: Natasha

Hello Natasha, I modified the play count in the XML file, but as soon as I started iTunes my changes were overwritten. I seems the XML file is regenerated each time iTunes starts and any updating is uni-directional. Any other ideas? Thanks!

Natashareply
9th May 2018 at 10:30 am
– In reply to: Mistico

Hey! Are you using a mac? Have you tried saving my apple script? I haven’t changed the play count using the XML file but I can look into it if the script doesn’t work.

Mistico
9th May 2018 at 2:24 pm
– In reply to: Natasha

Hello, no, I am using Windows 7. Is there a version of the script for Windows? Thanks.

Natasha
9th May 2018 at 2:33 pm
– In reply to: Mistico

I found this: http://samsoft.org.uk/iTunes/scripts.asp. Was developed a while ago so I wonder if it still works but I would be interested if you managed to get it up and running.

Misticoreply
20th May 2018 at 12:09 am

Hello again Natasha, I built a tool to edit the iTunes play-count on Windows (https://github.com/CDEngineer/iTunesDataEditor/releases) Thanks for all your help!

Natashareply
21st May 2018 at 12:16 pm
– In reply to: Mistico

That’s so cool!! Wow. Thank you. How does it work exactly? I am going to put a link to it in the article. Do you want any credits (name/website/anything else..)?

Misticoreply
21st May 2018 at 5:37 pm
– In reply to: Natasha

You’re welcome! You should link to https://github.com/CDEngineer/iTunesDataEditor the instructions are there (the /releases page contains only the binaries). In a nutshell, you create a playlist with the songs you want to edit, fire this tool, select that playlist and then you have a grid with all the songs, double click the play count and change it, when you press ENTER it is saved to the iTunes library. Hopefully some one will find this helpful. Thanks again!

Natashareply
22nd May 2018 at 9:12 am
– In reply to: Mistico

Brilliant. You’re in the post now!

Scott Foubisterreply
18th July 2018 at 4:18 pm

Natasha, this is amazing! This is exactly what I have needed for a long time to combine play counts for duplicate copies of songs (from different albums/downloads), so I can deduplicate my iTunes library without losing my precious play count data. As you walk around today, no one in person will know that you are an AppleScript angel. But commenters on this page do, and we appreciate you!

Natashareply
19th July 2018 at 5:03 pm
– In reply to: Scott Foubister

You made my day!! It’s really the little things in life hey..?

Andrewreply
14th August 2018 at 10:27 pm

Thank you so much for this! But there is a problem for me… I saved the script in the folder and there is also an icon of the script in the top bar of iTunes’ window. But when I push the “OK” button in the script plays are not changing at all. I’m getting the feeling i’m still doing something wrong… Can you please help me with this? Would really appreciate it
Thank you in advance!

Natashareply
15th August 2018 at 5:53 pm
– In reply to: Andrew

Hey Andrew. Thanks for getting in touch! I am emailing you directly a zipped file of the script I have installed on my computer. I just double checked that my script still works, and it does. I am running iTunes 12.8.0.150 on my Mac. Let me know what happens.

Josuke Higashikatareply
10th September 2018 at 1:32 am

Thank you SO SO SO much for this! I’m one of those “anal about iTunes” people and recently my most played song of all time got corrupted somehow. The past month or so I’ve just gone without listening to it rather than replace it because I didn’t want the play count to drop down to zero. I’ve also been meaning to upgrade a lot of my music to 320kbps versions so this will come in handy there as well.

What connects Claude Debussy, Ella Fitzgerald & Melba Doretta Liston? – Chikaboo Designsreply
3rd October 2018 at 1:31 pm

[…] iTunes library; turns out there are other music crazies on the internet who’ve gone mad for AppleScripts – Edit your iTunes Play Count. I love the internet, it makes me feel less […]

Leave a reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.