Update playcount manually with this script - iLounge Forums
Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.

Topic: Update playcount manually with this script

Reply Thread Tools Topic Search
Old 07-22-2004, 05:33 AM
#1
 
Junior Lounger
 
Join Date: May 2004
Location: Helsinki, Finland
Posts: 66
Update playcount/last played manually with these scripts

I made a small and simple script to edit a song's playcount. Why, you ask. Sometimes you might listen to low quality song 10 times on your iPod, decide to re-rip it with better quality, and replace the old copy with the new. I personally like to "transfer" the playcount to the new copy of the old song.

Somebody propably has already made something similar to this, but here's my take on it. Feel free to use it and abuse it, it's only a few lines of code.

Here you go:

Code:
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
Copy-paste the above text in Notepad and save it as SetPlayCount.vbs.

To use it the script, play the song you want to edit in iTunes, double click the script file, feed new playcount into the inputbox. That's it.

I made the script for my own personal use and have tested it on my own computer. As you can see from the listing, it really shouldn't do anything critical, but I can't guarantee anything.

Hope that makes sense and somebody finds it useful.

Last edited by Tiketti; 11-02-2006 at 11:16 AM.
Tiketti is offline  
Reply With Quote
Old 07-27-2004, 11:50 AM
#2
 
Freshman Lounger
 
Join Date: May 2004
Location: Munich, Germany
Posts: 7

Thanks for Your fine Script!
It is verry usefull for me and I like it verry much. It works great for me!

Do you know a method to edit the "Date Added"?
If I replace a song with another version I the info for date added changes. I have a playlist "New Songs" with my songs added in the last two months, in which I don't want the modified songs to appear. It would be a graet feature!

Thanks in advance!
Der_Wolf is offline  
Reply With Quote
Old 08-13-2004, 02:35 AM
#3
 
Junior Lounger
 
Join Date: May 2004
Location: Helsinki, Finland
Posts: 66

Thanks, I'm glad it's of use to you.

Sorry it took me a while to reply. I just tested this and it seems DateAdded is a read-only property. Meaning I can't change it with an iTunes script. Some people have been hacking the iPod database by other means but these iTunes scripts are easier and safer to make.

But, in case anybody is interested, here's a similar script to change the Last Played Date:

Code:
Dim iTunesApp, currTrack, newLastPlayed
Dim prompt, title, defaultValue, errorMsg

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

prompt = "Set Last Played as:"
title = currTrack.Artist & " - " & currTrack.Name
errorMsg = "Error in date format"
defaultValue = currTrack.PlayedDate

newLastPlayed = InputBox (prompt, title, defaultValue)
If IsDate(newLastPlayed) Then
	currTrack.PlayedDate = newLastPlayed
Else
	MsgBox(errorMsg)
End If
Tiketti is offline  
Reply With Quote
Old 08-17-2004, 07:39 PM
#4
 
Senior Lounger
 
Join Date: Sep 2003
Location: Los Angeles, CA
Posts: 160

Is there anywhere on the web where I can find a reference for making my own VBS scripts??? I'd really be interested in trying to make a few of my own!! THANKS!



Click the image to open in full size.
b-boy is offline  
Reply With Quote
Old 08-20-2004, 05:23 AM
#5
 
Junior Lounger
 
Join Date: May 2004
Location: Helsinki, Finland
Posts: 66

I haven't found a resource. The way I do it is I use the Object Browser in Visual Studio to see what properties and methods the iTunes object supports.
Tiketti is offline  
Reply With Quote
Old 07-24-2005, 02:36 PM
#6
 
Junior Lounger
 
Join Date: Nov 2004
Location: Seattle
Posts: 37
Talking THANK YOU - THANK YOU!!!

Thanks much for this. I was getting some really weird things with my playcounts. About 30 songs had numbers like this -1203898

Weird, huh? Even the folks at APPLE Store couldn't help me other than to RESET (and erase) everything on my iPod. I didn't want to do that. Too much risk if you ask me. but your simple little tool is GREAT! Thank you very much!
Rondo1 is offline  
Reply With Quote
Old 07-24-2005, 05:35 PM
#7
 
Freshman Lounger
 
Join Date: Jun 2005
Posts: 23

COM details for the nerds - http://developer.apple.com/sdk/itunescomsdk.html



iTunesRegistry.com: 17,082 tracks, 5.432 diversity
a1ehouse is offline  
Reply With Quote
Old 08-02-2005, 07:08 AM
#8
 
Junior Lounger
 
Join Date: May 2004
Location: Helsinki, Finland
Posts: 66

Hey no problem. I'm glad you found it useful.

I might tweak it and make the script recognize the tracks selected in iTunes instead of the one playing.
Tiketti is offline  
Reply With Quote
Old 08-02-2005, 12:50 PM
#9
 
Freshman Lounger
 
Join Date: Jun 2005
Posts: 23

Quote:
Originally posted by Tiketti
Hey no problem. I'm glad you found it useful.

I might tweak it and make the script recognize the tracks selected in iTunes instead of the one playing.
Better way to do it Tiketti!



iTunesRegistry.com: 17,082 tracks, 5.432 diversity
a1ehouse is offline  
Reply With Quote
Old 11-02-2006, 11:15 AM
#10
 
Junior Lounger
 
Join Date: May 2004
Location: Helsinki, Finland
Posts: 66

Here we go again with the same old scripts. Except this one I find myself using fairly frequently. Tested with 6.x and 7.0-7.0.2.

This script asks for a new playcount for all songs that have been selected in iTunes. Ctrl-click or shift-click tracks you want to change playcount for and run the script.

Copy this script into Notepad and save it with a .vbs extension. Double-click the file to run. You can also set a global hotkey for the script by making a shortcut to the file, right-clicking it and selecting Properties / Shortcut / Shortcut key.

Code:
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
Tiketti is offline  
Reply With Quote
Old 11-05-2006, 03:13 PM
#11
 
Freshman Lounger
 
Join Date: Nov 2006
Posts: 1

Hello, I am not very good with scripts or anything, and I attempted to use this when I double-clicked it, like you said, and I got the error "Library not registered". Do you have any idea what may have caused this?
momo1tx is offline  
Reply With Quote
Old 11-06-2006, 09:52 AM
#12
 

 
Join Date: Apr 2006
Location: Arizona
Posts: 9,238

The most likely reason for Library not Registered errors is the iTunes install is not good or complete.



Have you backed up your iTunes Library this week? If not, you are risking losing your music and playlists....
cjmnews is offline  
Reply With Quote
Old 05-23-2007, 03:43 AM
#13
 
Freshman Lounger
 
Join Date: Nov 2005
Location: Edmonton, AB, Canada
Posts: 16

I'm happy to report that the script for modifying the selected tracks' playcount works perfectly in iTunes 7.1.1.5. This is exactly what I've been looking for!
evilspoons is offline  
Reply With Quote
Old 08-24-2007, 08:27 AM
#14
 
Junior Lounger
 
Join Date: Jul 2006
Posts: 98

Will these work in Windows?



5th Gen. 30GB Video iPod // 5493 songs
iPodBlanc is offline  
Reply With Quote
Old 08-24-2007, 11:25 AM
#15
 
Junior Lounger
 
Join Date: May 2004
Location: Helsinki, Finland
Posts: 66

^ These scripts will work only in Windows.
Tiketti is offline  
Reply With Quote

Topic: Update playcount manually with this script

Reply Thread Tools Topic Search

Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



RSS Feed Widget

iLounge Weekly
News, reviews, articles, giveaways, deals, and more delivered to your inbox.
Sign up for the iLounge Weekly Newsletter

iLounge is an independent resource for all things iPod, iPhone, iPad, and beyond.
iPod, iPhone, iPad, iTunes, Apple TV, Mac, and the Apple logo are trademarks of Apple Inc.
iLounge is © 2001 - 2016 iLounge, Inc. All Rights Reserved. Terms of Use | Privacy Policy