[Pythonmac-SIG] py-appscript: Rating a Song with Applescript

William Reardon wdr1 at pobox.com
Tue Jan 19 04:04:24 CET 2010

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?

tell application "iTunes"
  set ts to (every file track of playlist "Library" whose name is track_name
and artist is track_artist and album is track_album)
  repeat with t in ts
    set rating of t to track_rating
  end repeat
end tell

Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20100118/ac9986cf/attachment.htm>

More information about the Pythonmac-SIG mailing list