Ok so I have a working script using a repeat loop that goes in a document and changes ever border of cells that have a bottom edge stroke weight to 0 and puts a red stroke of 1 pt instead. That works, but it is really long because the script as to go through every cell of every table of the document. I’ve tried to use cell whose bottom edge stroke weight is 0 to do the same thing but it just puts the red stroke on every bottom edge stroke instead of using my whose statement.
Here’s the script that works, I’m also doing all edge of the cell
tell application “Adobe InDesign CC”
set myDocument to active document
tell myDocument
try
set mySwatch to (make color with properties {model:process, space:RGB, color value:{255.0, 0.0, 0.0}, name:"ROUGE"})
end try
set mytableStroke to color "ROUGE"
set allTables to tables of text frames of myDocument
repeat with i from 1 to count of allTables
tell item i of allTables
repeat with j from (count of cells) to 1 by -1
try
set mybottomstroke to (bottom edge stroke weight of cell j)
set myLeftStroke to (left edge stroke weight of cell j)
set myRightStroke to (right edge stroke weight of cell j)
set myTopStroke to (top edge stroke weight of cell j)
if mybottomstroke is 0 then
set properties of cell j to {bottom edge stroke weight:"1 pt", bottom edge stroke color:mytableStroke, bottom edge stroke tint:100}
end if
if myLeftStroke is 0 then
set properties of cell j to {left edge stroke weight:"1 pt", left edge stroke color:mytableStroke, left edge stroke tint:100}
end if
if myRightStroke is 0 then
set properties of cell j to {right edge stroke weight:"1 pt", right edge stroke color:mytableStroke, right edge stroke tint:100}
end if
if myTopStroke is 0 then
set properties of cell j to {top edge stroke weight:"1 pt", top edge stroke color:mytableStroke, top edge stroke tint:100}
end if
end try
end repeat
end tell
end repeat
end tell
activate
beep
end tell
Now here’s the script that doesn’t work as intended:
tell application “Adobe InDesign CC”
set myDocument to active document
tell myDocument
try
set mySwatch to (make color with properties {model:process, space:RGB, color value:{255.0, 0.0, 0.0}, name:"ROUGE"})
end try
set mytableStroke to color "ROUGE"
tell (cells whose bottom edge stroke weight is 0) of tables of text frames of myDocument to set properties to {bottom edge stroke weight:"1 pt", bottom edge stroke color:mytableStroke, bottom edge stroke tint:100}
end tell
activate
beep
end tell
Any hint would be great!
TIA
Jeff