Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use iTunes search box to search by ratings' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use iTunes search box to search by ratings
Authored by: podd on Mar 19, '04 05:39:43PM
Using Python:

#!/usr/local/bin/pythonw

import re
from appscript import *

for track in app('iTunes.app').selection.get():
	rating = track.rating.get() // 20
	comment = track.comment.get()
	comment = re.sub(' [=*]{5}$', '', comment) # remove existing 'rating', if any
	comment += ' ' + '*****====='[5 - rating:10 - rating] # append new 'rating'
	track.comment.set(comment)
(Requires MacPython 2.3+ and appscript.)

[ Reply to This | # ]