YES!!! I have figured it out!!! MWAHAHAHA
Instead of using the time, I used the finish, which shows how many seconds until the finish of the song...
So far, I'm only able to give a total in seconds, but with a calculator, you can do the math. I've played music for a total of:
16 days, 17 hours, 40 minutes, and 50 seconds.
Now, I need to find a way to get this script to get data from an iPod...
here's the code:
Code:
tell application "Finder"
set myLocation to (((path to desktop folder) as text) & "iTunes_PlayCount.html")
if file myLocation exists then
delete file myLocation
end if
set myFileRef to (open for access file myLocation with write permission)
write "<HTML><HEAD><TITLE>my Play Counts </TITLE></HEAD><BODY>" & return to myFileRef
write "<p>My playcounts for all my songs...</p>" & return to myFileRef
write "<TABLE width=800 border=1>" & return to myFileRef
tell application "iTunes"
set myPlaylist to every playlist
set x to the first item of myPlaylist
set myTrackList to every track of x
set myTotalTime to 0
repeat with y in myTrackList
set myTrackName to name of y
set myTrackTime to finish of y
set myTrackTimeText to time of y
set myPlayedCount to played count of y
if myPlayedCount > 0 then
tell application "Finder"
write "<tr><td>" & myTrackName & "</td>" & "<td width=15%>" & myPlayedCount & "</td>" & "<td width=15%>" & myTrackTime & "<td width=15%>" & myTrackTimeText & "</td>" & "</td></tr>" & return to myFileRef
end tell
set myPlayedTime to myTrackTime * myPlayedCount
set myTotalTime to myTotalTime + myPlayedTime
end if
end repeat
end tell
write "</TABLE>" & return to myFileRef
write "<p>" & "Total Time Played: " & myTotalTime & " seconds" & return to myFileRef
write "</BODY></HTML>" & return to myFileRef
close access myFileRef
display dialog ("Finished Summary")
end tell
Have fun!