Categories: Misc / DotNet / Java / Coder / Linux / PHP Ask - La ask - La Answer

Delete "Last Played"

Please choose the appropriate forum for this topic. Thank you. When I download songs from Amazon, they automatically start playing in iTunes. Since I'm on dial-up, that's usually in the middle of the night, so I'd like to go back and remove the played info.
tell application "iTunes"
set played date of selection to date (REMOVE)
set played count of selection to 0
end tell
Delete doesn't work. How do I remove it? (Remove & clear don't work, either.)
[498 byte] By [doulos12] at [2007-11-10 14:15:43]
# 1 Re: Delete "Last Played"
Is "Play songs while importing" checked in your Import Preferences? Uncheck it. That will prevent songs from playing.

You need to get the current date and use that as the date in your script, if this is still necessary.
Doug Adams at 2007-11-15 17:24:28 >
# 2 Re: Delete "Last Played"
Is "Play songs while importing" checked in your Import Preferences? Uncheck it. That will prevent songs from playing.
No, I checked all that repeatedly. I don't get it.

And I actually want to get rid of the date altogether to make the track appear to be a "virgin" track.
doulos12 at 2007-11-15 17:25:28 >
# 3 Re: Delete "Last Played"
Hmm. Odd. Well, then just set played date to some old date (you can't blank the played date that I am aware of) and play count to 0:
set dumb_date to (date "Friday, August 14, 1987 12:00:00 AM")

tell application "iTunes"
set sel to selection of front browser window
repeat with a_track in sel
tell a_track
set {played count, played date} to {0, dumb_date}
end tell
end repeat
end tell

Select some tracks and run the script.
Doug Adams at 2007-11-15 17:26:23 >
[an error occurred while processing this directive]
[an error occurred while processing this directive]