Indesign modify all text boxes on a page.

Hi All,

Working in InDesign CS 3 and trying to get a script to change all the text boxes. I can get the script to select the boxes but not change the text contents.

At the moment I have a blank page with 4 text boxes with the number “1” in it.

set textboxnum to 1

tell application "Adobe InDesign CS3"
	tell document 1
		set textframes to every text frame of page 1
		repeat with a in textframes
			select a
			set aprop to properties of a
			set contents of properties of a to ("text box " & textboxnum) as string
			beep 1
			set textboxnum to (textboxnum + 1)
		end repeat
	end tell
end tell

Any ideas?? Thanks.

Model: G4 933
Browser: Firefox 3.0.19
Operating System: Mac OS X (10.4)


selection of the text box is actually not necessary

tell application "Adobe InDesign CS3"
	tell document 1
		set allTextBoxes to text frames of page 1
		repeat with textboxnum from 1 to count allTextBoxes
			set currentTextBox to item textboxnum of allTextBoxes
			set contents of currentTextBox to ("text box " & textboxnum)
		end repeat
	end tell
end tell

Thanks Stefan. All good.

I think it was the syntax of the repeat statement that was wrong. needed "from 1 to count… "

Thanks again.