HI, I'm having trouble modifying a table. I need to add 2 rows between each existing body rows to get the look of the table right. Here's what it's supposed to look like. and here is what I'm at right now. As you can see, I get pretty far, but I don't know how to add rows from the second row (initial rows) to before the last row of the table. The number of rows will vary from table to table, so I need a way to count the number of rows of my selection, but everything I tried to increment that fails. It's like once I add a row to the table, my initial selection is not valid and it's like the selection is the document, not the table. Anyway, here's my script that does what you can see in the second image. tell application id "com.adobe.indesign"
tell active document
--Set the measurement units to points for the duration of the script
--getting the user units in memory
set myOldHorizontalUnits to horizontal measurement units of view preferences
set myOldVerticalUnits to vertical measurement units of view preferences
set horizontal measurement units of view preferences to points
set vertical measurement units of view preferences to points
set mycolor to swatch "PANTONE 288 U"
set myColorWhite to swatch "Paper"
set myTabFond to swatch "Tab fond"
set mythinStroke to "0.25 pt"
set myTextStyle to paragraph style "F-TX tableau texte" of paragraph style group "RFP-FIN"
set myTextEntete to paragraph style "F-TAB Tete gauche 2" of paragraph style group "TABLEAU"
set myCharacterStyle to character style "Medium"
set TargetSelection to item 1 of selection
set NumberOfColumnsOfSelection to count of column of TargetSelection
set NumberOfRowsOfSelection to count of row of TargetSelection
--format toute les cellules
tell cells of selection
clear cell style overrides
set bottom edge stroke weight to mythinStroke
set top edge stroke weight to mythinStroke
set left edge stroke weight to 0
set right edge stroke weight to 0
set top inset to "2 pt"
set bottom inset to "6 pt"
set left inset to "6 pt"
set right inset to "6 pt"
set first baseline offset to fixed height
set minimum first baseline offset to "9 pt"
set vertical justification to top align
tell text 1
set applied paragraph style to myTextStyle
end tell
end tell
--set la largeur des colonnes
tell TargetSelection
set width of column 1 to 84
set width of column 2 to 207
set width of column 3 to 210
end tell
--met les stroke de chaque côté de la colonne centrale
tell cells of column 2 of selection
set left edge stroke weight to mythinStroke
set right edge stroke weight to mythinStroke
end tell
tell cells of column 1 of selection
set fill color to myTabFond
end tell
make column at after column 1 of TargetSelection with properties {width:"3 pt", left edge stroke weight:"0 pt", fill color:myColorWhite}
--partie pour Entête
tell cells of row 1 of selection
set fill color to mycolor
set bottom edge stroke weight to 0
set top edge stroke weight to 0
set top inset to "1 pt"
set bottom inset to "1 pt"
set left edge stroke color to myColorWhite
set first baseline offset to ascent offset
set minimum first baseline offset to "0 pt"
tell text 1
set applied paragraph style to myTextEntete
set applied character style to myCharacterStyle
set fill color to myColorWhite
set first line indent of paragraphs to 0
set left indent of paragraphs to 0
end tell
end tell
tell cell 1 of column 3 of selection
set left edge stroke weight to 0.5
set right edge stroke weight to 0.5
end tell
make row at after row 1 of TargetSelection with properties {height:"3 pt", auto grow:false, inner column stroke weight:0}
make row at before row 1 of TargetSelection with properties {height:"3 pt", auto grow:false, inner column stroke weight:0}
make row at before row 4 of TargetSelection with properties {height:"3 pt", auto grow:false, inner column stroke weight:0, fill color:myColorWhite}
make row at after row -1 of TargetSelection with properties {height:"3 pt", auto grow:false, inner column stroke weight:0, top edge stroke weight:0, fill color:myColorWhite}
--set myNumberOfRowsForGapRows to ((count of NumberOfRowsOfSelection) - 2)
--get myNumberOfRowsForGapRows
--reseting the users units prefs
set horizontal measurement units of view preferences to myOldHorizontalUnits
set vertical measurement units of view preferences to myOldVerticalUnits
end tell
end tell If anybody has any ideas, in Applescript, how to do that, it would be great. TIA!
... View more