“Purple Rain” Booster

Description

I saw a tweet that made me laugh:
I've run out of stars to rate "Purple Rain" in iTunes. Need to write an applescript that will lower all other albums by one star.
I couldn't agree more with @sugarfreejones, so here's that script! It will lower every non-"Purple Rain" album in your current view/window/playlist by one star!

And for those with different tastes, just type in the name of your favorite album in its place. (sigh)

The Code

(*
Veritrope.com
'Purple Rain' Booster
VERSION 1.0
December 5, 2010

// UPDATE NOTICES
     ** Follow @Veritrope on Twitter and Facebook for Update Notices! **

// SUPPORT VERITROPE!
     If this AppleScript was useful to you, please take a second to show your love here:
     http://veritrope.com/support

// TERMS OF USE:
     This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

     To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.


*)



(*
======================================
// MAIN PROGRAM
======================================
*)



tell application "iTunes"
    set currentList to view of front window
    set rating_change to 20
    repeat with curTrack in (get every track of currentList)
        if rating of curTrack is greater than rating_change then
            if album of curTrack does not contain "Purple Rain" then
                set rating of curTrack to (rating of curTrack) - rating_change
            end if
        end if
    end repeat
end tell