Applescripting InDesign--can't get a property error (new scripter)

I’m trying to work with InDesign documents so that I can resize text frames using Applescript. These text boxes are associated with master spreads. Some are already overridden and some are not. I tried to do an if/then statement such that:

tell application “Adobe InDesign CS2”
tell document 1
set myPages to every page
repeat with i from 1 to (count of myPages)
set thePage to page i
set isOverridden to overridden of item 5 of page i
if isOverridden is false then
set theSpread to applied master of thePage
override page item 5 of theSpread destination page thePage

			end if
		end try
	end repeat
end tell

end tell

I found that I cannot get the line “set isOverridden to overridden of item 5 of page i” to work. I get an error that says “Adobe InDesign CS2 got an error: Can’t get overridden of item 5 of page 1 of document 1.” I tried just that line by itself and it still would not work. Funny thing is I copied that line directly from Shirley Hopkins book “Applescripting InDesign”, written for CS and Panther. I’m on CS2 and Tiger. Could that be a problem? I’ve noticed other broken statements in InDesign, but could do workarounds for them.

Okay, thanks. Any help is appreciated

if you don’t mind overridding all of the iems - you can do something like this:

set spreadID to the index of parent of page selectedSpread
		set spreadPages to the name of every page of spread spreadID
		repeat with p from 1 to count of spreadPages
			set myMasterPageItems to master page items of page (item p of spreadPages)
			repeat with myCounter from 1 to count of myMasterPageItems
				if label of (item myCounter of myMasterPageItems) is not "" then
					override (item myCounter of myMasterPageItems) destination page page (item p of spreadPages)
				end if
			end repeat
		end repeat

Thanks, I’ll try this.