Hello there,
i’m using indesign 2.0.
I’d like to automatically format table.
I’ve no problem to set the title style or content style, but i can’t figure how to have an alternate filling tint of my rows.
I’m stucked.
If someone could give some advice i would be really grateful.
Heres my code
tell application "InDesign 2.0.1"
activate
set myDoc to active document
tell myDoc
set Blue20 to color "Blue20"
set BlueColor to color "Blue"
set tabligne to paragraph style "tabligne"
set styletitre to paragraph style "tabtitre"
set mySelection to item 1 of selection
set NumberOfColumns to count column of mySelection
set NumberOfrows to count row of mySelection
-- Styles
set applied paragraph style of parent story of row 1 of mySelection to styletitre
set row2ThruMinus1 to rows 2 thru -1 of mySelection
repeat with aRow in row2ThruMinus1
set applied paragraph style of parent story of aRow to tabligneCenter
end repeat
-- Stroke
set properties of mySelection to {fill color:blue ¬
, inner column stroke weight:0.0, inner row stroke weight:0.0, top edge stroke weight:0.0, bottom edge stroke weight:0.0, left edge stroke weight:0, right edge stroke weight:0}
set properties of mySelection to {inner column stroke color:BlueColor, inner row stroke color:BlueColor ¬
, left edge stroke color:color BlueColor, right edge stroke color:color BlueColor ¬
, bottom edge stroke color:BlueColor, top edge stroke color:BlueColor}
-- Height, inset
set properties of mySelection to {height:2.8, vertical justification:center, left inset:0, right inset:0, top inset:0, bottom inset:0}
-- Width, inset
set properties of ((columns 1 thru -1) of mySelection) to {width:(85 / NumberOfColumns)}
end tell
end tell