iTunesの曲の再生回数を任意に変更するAppleScript

Mac向け。まず

アプリケーション > AppleScript > スクリプトエディタ.app

を起動して、

tell application "iTunes"
	try
		set trk to {}
		set slct to a reference to selection
		if slct as list is {} then return
		repeat with x in slct
			set end of trk to (name of x as Unicode text) & (" (" & played count of x & ")")
		end repeat
		set AppleScript's text item delimiters to ", "
		set y to text returned of (display dialog ((trk as Unicode text) & " の再生回数を変更") default answer "")
		if y is false then return
		set played count of slct to y
	end try
end tell

これをコピペ。「スクリプト」形式で保存し

ユーザ > ライブラリ > iTunes > Scripts

に入れてiTunesを再起動すると使えます。