Shuffle Toggler not working with iTunes 7

Bruce had helped me write a script back in May that I’ve really grown accustom to. I’ve attached it to a QuicKey and no matter what app I’m in, I can toggle whether or not iTunes is in shuffle mode or not. Since upgrading to version 7 last week, it no longer works. It register the keypress and the dialog pops up, but shuffle does not activate or deactivate. Can you glance over this and and ponder any changes to the iTunes coding stucture that would cause this applescript to die? I’m wondering if the library area has changed since it now has music, movies, tv, etc.

property itunesicon : path to resource "iTunes.icns" in
bundle (path to application "iTunes")

tell application "iTunes"
	get ((((shuffle of first library playlist) as integer) + 1) mod 2) as
boolean
 set ShuffleAnswer to result
	set shuffle of first library playlist to ShuffleAnswer
end tell
if ShuffleAnswer is equal to false then
	display dialog "       Shuffle Off" buttons ("Sweet.") with icon
itunesicon giving up after 1 default button "Sweet."
else
	display dialog "       Shuffle On" buttons ("Sweet.") with icon
itunesicon giving up after 1 default button "Sweet."
end if

Thanks for your help in advance,
slimjim5811

Works great, Jacques!
Thanks!:smiley:
slimjim5811