Can script be written to ignore class errors?

I wrote a script to relink same image to multiple locations in an InDesign CS3 document.
The script does exactly what I want it to do, but…

I always get class errors: “Can’t get {<> id 8128 of <> id 8124 of <> id 4723 of <>” etc, etc…

Is there a way to ignore displaying these errors?

This is the part of the script that does the work:



on process_item(this_item)
	tell application "Adobe InDesign CS3"
		activate
		set TRI to open "Production:Templates:Master.indd"
		tell TRI
			set myLinks to links whose name is "ReplaceMe.pdf"
			repeat with myCounter from 1 to (count myLinks)
				relink myLinks to this_item as alias
				try
					update myLinks
				end try
			end repeat
		end tell
	end tell
end process_item

Thanks in advance

You’re attempting to repeat with nonexistent items. Nix the repeat loop.

Duh
That did it.
Thanks Marc!