My second list overwrites my first list

I am trying to sort thru every text frame of an InDesign CS document, finding all the fill colors of the first text frame, and then go on
to every other text frame and wind up with a list that contains every fill color used on that page.
Alas, my script goes thru the first text frame, creates the list, but overwrites it with the fill colors of the next text frame.
How do I create a list for the first text frame, create a seperate list for the next text frame without overwriting the first list, and then sort the latter list, placing any new fill colors into the first list? (The problem is, I don’t know how many text frames there are, so I can’t use things like “second text frame”, etc. The search capabilities of InDesign CS seem to be rather limited, but InDesign CS is all I have right now.

tell application "InDesign CS"
	set myDoc to document 1
	tell myDoc
		set everyTextframe to object reference of every text frame
		repeat with i from 1 to (count everyTextframe)
			set thisTextframe to (item i of everyTextframe)
			set all_fillcolors to (the name of fill color of every word of thisTextframe)
			set return_list to {}
			repeat with a_fillcolor in all_fillcolors
				if return_list does not contain a_fillcolor then set end of return_list to (contents of a_fillcolor)
			end repeat
			set those_fillcolors to return_list
			set theFillList to {}
			if theFillList does not contain those_fillcolors then set end of theFillList to (those_fillcolors)
		end repeat
		set theFillList to theFillList as string
	end tell
end tell

put your set return_list to {} out side your repeat (set it at the beginning). you are currently clearing it every time it repeats the everyTextframe

Thanks, that’s a mistake I won’t make again. Sometimes you just can’t see the forest for all the darn trees!