delete images

Hi All
I have a program which delete all picture boxes and set back grount color to null: But I am unable to run it on OSX can some one help me.

tell application "QuarkXPress"
	activate
	tell front document
		set tool mode to drag mode
		set tot to count of every picture box
		repeat with i from tot to 1 by -1
			if anchored of picture box i then
				select picture box i
				cut current box
			else
				delete picture box i
			end if
		end repeat
		
		display dialog "Total of " & tot & " picture boxes
has been deleted successfully." buttons {"OK"} default button 1
		set cc to count of every generic box
		repeat with i from 1 to cc
			select generic box i
			if color of current box is not equal to null then
				set color of current box to null
			end if
		end repeat
	end tell
end tell

And the problem occurs in set color of current box to null line.
I have also post another program for deletion header & footer.

Regards
Rajeev