tell application "InDesign CS"
tell document 1 to make new section with properties {include section prefix:true, page start:page 6, page number style:lower roman}
end tell
This could be too little too late, but here’s a script I am working on to set page sections and numbers from user input. It’s a work in process, and I’m learning as I go, so really all this does so far is to set the start page to a number specified by the user, and set the section preset to L, R, or #.
The end goal is to have a document where pages 1-20 are numbered L1, L2, etc., and 21-40 are R1, R2, etc., and 41-50 are 1, 2, 3, etc.
Hopefully this helps someone, it’s been fun learning (so far).
tell application "Adobe InDesign CS3"
try
set myDoc to the active document
tell myDoc
--This asks the user how many colors will be in section one. Need to link result to page range...
display dialog "How many colors on the Left?" default answer "20" buttons {"OK"} default button 1 with icon 1
copy the result as list to {leftPages}
--This asks the user about the section being left or right, then coerces the result into an integer and shoves it into the section properties as startNumber. If lefts are always first, this may be useless...
display dialog "Do these labels begin with L, R, or #?" buttons {"L", "R", "#"} default button 1 with icon 1
copy the result as list to {sectionPrefix}
repeat
set dialogResult to (display dialog "Enter a starting number:" default answer "1" with icon 1)
try
set startNumber to (text returned of dialogResult) as number
if (class of startNumber is integer) then exit repeat
end try
end repeat
--This is where the section properties are set up
set leftSection to section 1
tell leftSection
set properties to {continue numbering:false, page number start:startNumber, section prefix:sectionPrefix, include section prefix:true, page number style:arabic}
end tell
end tell
--If there's an error of any kind, this will alert the user to the error
on error the errorMessage number the errorNumber
display dialog "Error: " & the errorNumber & ". " & the errorMessage buttons {"OK"} with icon 2
end try
end tell