InDesign section script

Hi all,

I hope you can help me. I tried to make sections for every page in InDesign CS2. But the debugger always responds that the section cannot be made. Where’s my mistake? I don’t really understand it. It works fine if I take a special page number.

tell application "Adobe InDesign CS2"
	set mydoc to active document
	set pagecount to count pages of active document
	set spreadPages to name of every page of active document
	repeat with myCounter from 1 to (count spreadPages)
		set mypage to name of page myCounter of mydoc
		tell mydoc
			set mysect to make section
				set properties of mysect to {continue numbering:false, page start:page item myCounter of mydoc, page number start:item myCounter of mydoc, include section prefix:false, page number style:arabic}
			end try
		end tell
	end repeat
end tell

I would be glad to get this working.
Thanks for help.



you could simplify this code with a tell document 1

set the repaeat with count of pages

also you need to set the properties when you make the section not after

like this

make new section with properties {,,,,,,} -- put the properties between the commas 

you should look at the dictionary to determine the alvailable properties