<span style="font-family: courier new,monospace;"><span style="font-family: arial,helvetica,sans-serif;">I'm attempting to programmatically rate a song in iTunes. I hacked together the following snippet in Applescript, but after reading the docs, I can't figure out how to convert the "every file..." mechanic to the py-appscript equivalent. Any suggestions?</span><br style="font-family: arial,helvetica,sans-serif;">
<br>tell application "iTunes"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> set ts to (every file track of playlist "Library" whose name is track_name and artist is track_artist and album is track_album) </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> repeat with t in ts</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> set rating of t to track_rating</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> end repeat</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end tell</span><br><br>Thanks in advance,<br>-Bill<br>
<br>