<span style="font-family: courier new,monospace;"><span style="font-family: arial,helvetica,sans-serif;">I&#39;m attempting to programmatically rate a song in iTunes.  I hacked together the following snippet in Applescript, but after reading the docs, I can&#39;t figure out how to convert the &quot;every file...&quot; mechanic to the py-appscript equivalent.  Any suggestions?</span><br style="font-family: arial,helvetica,sans-serif;">
<br>tell application &quot;iTunes&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  set ts to (every file track of playlist &quot;Library&quot; 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>