Setting Play Count in Music app

It’s a default setting on forums to reduce issues with bots, spam and so forth. It will be a preset time like a minute, though might be longer here.

It already is.

Same result. (I’m running these from Script Editor, but that shouldn’t make a difference as far as I’m aware.)

Sure, and if it had said “60” instead of “%s”, I wouldn’t have reported it.

No, it’s not working. I thought for a moment that it might be because the tracks aren’t downloaded to this computer, but Doug’s script works fine on just these tracks.

Did you see Doug’s memo about possible bug

https://dougscripts.com/itunes/2016/04/play-counts-bug/

Yes, and I’ve been subject to it for years, but it doesn’t stop the script from changing the play count. As I said, Doug’s New Play Count script works fine.

The main question remains is : what is your playlist “Play Count Util”. It is some downloaded playlist or something other? And, are you sure it is not downloaded to Music library? Because when I try to read play count of free URL track, it has not Get Info either.

If you don’t clarify the situation and the user with a paid account in the iTunes Store does not appear, you are unlikely to be provided with assistance in obtaining a working solution.

Start by believing that the Doug’s app doesn’t do magic that can’t be repeated. One thing is for sure: it is paid, as well as iTunes Store.

and,

It already is or it already was? And what it IS or WAS, ON or OFF? It is fully unclear for other users, and leads them away from understanding the problem and solving it.

I will make it clear and understandable:

[format]Go Safari–>Preferences–>Reader, set “Automatically use Reader” on mascripter.net to ON[/format]
, and you have problems when trying publish post on mascripter.net

[format]Go Safari–>Preferences–>Reader, set “Automatically use Reader” on mascripter.net to OFF[/format]
, and you publish post on mascripter.net without problems

Yes, good question. It’s a Smart Playlist that shows all of the files in the Go Through playlist that don’t have a play count of zero.

iTunes Screenshot

I’m not sure what the iTunes Store has to do with this issue.

That’s exactly where I started, and why I’m harping on this. if Doug’s script can do it, there’s a way to do it. If our script doesn’t do what Doug’s can, we’re doing something wrong.

Come to think of it, perhaps the place to start is to try to replicate Doug’s script, and go from there. That way, nothing in my personal setup could be the problem.

Neither is true. It’s not paid, though donations are appreciated. And it is not iTunes Store, but freely downloadable from his site. It’s just a compiled, protected AppleScript.

If I had just then done it, I wouldn’t have said “it already is.” That seems pretty unambiguous to me. “It’s already the way you suggest.” But sure, it already was off before any of this started.

I don’t think you understand the problem. The problem is that I tried to post twice within 60 seconds, and it wouldn’t let me. But even that isn’t the problem; that’s just part of the design of the system. The problem is that it said “%s” instead of “60s” in the error message.

Okay, let’s leave the hocus pocus with Safari Reader alone. Let’s assume that I misunderstood you.

Finally, I managed to find out from you that you are working with smart-playlist, which is also uploaded to iCloud.

Now, it remains to find out which version of OS X you are working with. Because then you had “Operating System: macOS 10.14”, then you declare that “he above says” macOS 10.14, “but I’m using 10.15.”, But now under the rest of the posts the information is completely erased.

Also, It seems to me that I need to pull out information from you about the version of iTunes.app with pliers. No, I do not intend to do this anymore, as it is tiresome. You have already been answered by a more experienced user than me.

No, the smart playlist is not uploaded to iCloud; smart playlists which reference other smart playlists are not iCloud-compatible.

I’m running Catalina, 10.15.7.

I don’t recall you or anyone asking this before. My iTunes version is Music 1.0.6.10.

My current question is: Can anyone replicate the New Play Count functionality?

Model: MacBook Pro 2015
AppleScript: 2.7
Browser: Safari 605.1.15
Operating System: macOS 10.15

@Calion, hello.

You very well provided a screenshot of the “Play Count Util” playlist. Do you see those clouds with an arrow pointing down next to every song? They mean these songs are in iCloud. Now all that remains is to read the bug note posted by @technomorph. Or download the songs to your computer, reset play counts and upload them back to iCloud. If Apple hasn’t fixed this bug yet.

It’s hard to understand why the official New Play Count.app page still reminds you that the app doesn’t work with iCloud songs, and you claim it does. I think you better ask the Apple about how your problem is being solved.

Yes, the songs are in iCloud. But the playlists in question are not.

This bug is irrelevant to this situation. a) I’ve been subject to this bug for years; it doesn’t prevent AppleScript from changing the play count at all; it just means that it doesn’t “take” on a permanent basis. I’ve learned to deal with it, but it doesn’t affect the script in question (and, by the way, is unaffected, in my experience, by whether the song is downloaded to my machine. If it’s in iCloud at all—whether downloaded or not—this can happen). b) Doug’s New Play Count script works just fine on exactly these songs in exactly this playlist. So the problem can’t be some iCloud bug; it must be that we aren’t getting the script right.

The New Play Count.app page does not at all say that the app doesn’t work with iCloud songs. It just notifies the user of a potential bug that will cause play counts to spontaneously revert. My problem isn’t that the play counts are spontaneously reverting after they’re reset. My problem is that the play counts aren’t resetting—with any script I’ve been able to create—in the first place. Doug’s Script—and doing it manually—works just fine.

Hi. I don’t have anything later than Mojave installed, but perhaps you could test this.

tell application "iTunes"
	tell (playlist "Enya"'s tracks whose kind contains "audio" and location is not missing value)
		set unplayed to 1
		tracks's played count
	end tell
end tell

The Doug’s Script isn’t script but Doug’s Application. Assuming it works as you say, try to save my script in post #6 as application. If it will ask for some permissions, grant them. If it will work in application form, then the bug is related to script form. You can then solve this bug granting the same permissions to your Script Editor. Or, you can’t.

Once I change “iTunes” to “Music,” I get an error on run: "Music got an error: Unknown object type.” The word “unplayed” is selected, so I assume that “unplayed” is an unknown object type in Music.

That didn’t help. However, I did manage to get it working, although without any error-checking or anything, as that’s beyond my current skill level:

tell application "Music"
	repeat with t in (get tracks of playlist "Play Count Util")
		set the played count of t to 0
	end repeat
	set shuffle enabled to false
	play playlist "Go Through"
end tell

I…don’t know what in your script isn’t working, but at least we now know that it’s possible.

Now this is difficult to establish, so you threw out the check for the track class and the check for the fact that the play count is already = 0. Apparently, you are indifferent to debugging the script line by line and familiarizing users with the thrown error. If at all this error has ever been thrown. Because everything worked for me already starting from post # 6. I will remember you as a user with whom it is better not to communicate anymore. To preserve nerve cells.

Read the posting guidelines again and try to control your urge to attack other posters. If you’re not getting anywhere with them, simply stop replying.

I am very, very, very confused.

I’ve established that this is possible. I’ve found the basic problem. I tried to put my change back into your script, but it didn’t work. So there’s something wrong here that I don’t know what it is. I don’t know how to debug line by line if I can’t get the original script to work at all. Should I just throw random lines from your script in and see if they fail? That seems like a futile task. I was hoping that the information I gave would shed light on the problem.

I think you’re expecting me to know AppleScript well, but if I did, I probably wouldn’t need to have posted this problem.