3

Everything I can find on the internet seems to refer to a different version of macOS/iTunes than the ones I'm running. I want to reset the skip count of tracks without resetting their play counts, as well.

I'm fine with AppleScript, if that's how it has to be done, but something would be nice :)

  • which macOS? All tracks? Or selected tracks? – dwightk Mar 5 at 18:22
  • Selected tracks, macOS Mojave – Chris R Mar 5 at 19:24
6

This following AppleScript code works for me using the latest version of macOS Mojave.

tell application "iTunes"
    tell its track "Insert Your Song Title"
        set its skipped count to 0 -- Enter Your Desired Number     
    end tell
end tell

The following code addresses the issue of multiple songs with the same name.

tell application "iTunes"
    set theTrack to "Insert Your Song Title"
    set tracksRef to a reference to (tracks whose name is theTrack)

    set trackCount to count of tracksRef

    if trackCount is greater than 1 then
        set theArtists to artist of tracksRef
        set chooseArtist to (choose from list theArtists with title "Choose The Artist" with prompt ¬
            "Choose The Artist" OK button name "OK" cancel button name "Cancel") as text
        tell (every track whose name is theTrack and artist is chooseArtist)
            set skipped count to 0 -- Enter Your Desired Number     
        end tell
    else
        tell its track theTrack
            set its skipped count to 0 -- Enter Your Desired Number     
        end tell
    end if
end tell

This following code should work if you want to reset skipped count of every track.

tell application "iTunes"
    set allTracks to every track
    repeat with i from 1 to count of allTracks
        set thisItem to item i of allTracks
        tell thisItem
            try
                set its skipped count to 0 -- Enter Your Desired Number     
            end try
        end tell
    end repeat
end tell
  • 3
    What if you have two songs with the same name by different artists? (I know I do.) Only one of them is acted upon with your first code block. So you might want you add another tell block for that condition, e.g.: tell (every track whose name is "Insert Song Title" and artist is "Insert Artist Name") – user3439894 Mar 5 at 19:00
  • I ended up with a subtly different script than you gave, but the gist was from what you had. Thank you! – Chris R Mar 5 at 19:30
  • @user3439894 I updated my post to take into consideration your suggestion. Nice catch! – wch1zpink Mar 5 at 20:02
4

I noticed in the comment to your OP where you answered "Selected tracks" to dwightk's comment questions "All tracks? Or selected tracks?" So...

To reset the Skips count of all selected tracks, simply use:

tell application "iTunes" to set skipped count of selection to 0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .