Copy link to clipboard
Copied
Hi,
I'm working on a document that contains countless pages of continuous tables. Some of these cell extend beyond one page. As far as I know, Indesign doesn't manage multi page cells very well. So, I am creating separate rows for each paragraph, selecting those two rows, and changing the center border to '0'.
I would like to know the ExtendScript code to apply these properies to the selected cells. Thanks in advance.
Try this one
var cc = app.selection[0]
if( cc.cells.length < 2){
alert("Please select atleast 2 cells")
exit()
}
for(var i = 0; i < cc.cells.length; i++){
if(i == 0)
cc.cells[i].bottomEdgeStrokeWeight = 0
else if(i == cc.cells.length - 1)
cc.cells[i].topEdgeStrokeWeight = 0
else{
cc.cells[i].bottomEdgeStrokeWeight = 0
cc.cells[i].topEdgeStrokeWeight = 0
}
}
-Manan
Copy link to clipboard
Copied
Hi @Metallizr,
Try the following code
var cc = app.selection[0]
if(cc.cells.length != 2){
alert("Please select 2 cells only")
exit()
}
cc.cells[0].bottomEdgeStrokeWeight = cc.cells[1].topEdgeStrokeWeight = 0
-Manan
Copy link to clipboard
Copied
Thank you so much. This worked like a charm.
Copy link to clipboard
Copied
I ran into a small issue. Since I want to select more than two cells at once, I removed the if block. Now, only the top-most cell is affected by the script. How can I apply it to all the selected cells.
Copy link to clipboard
Copied
Try this one
var cc = app.selection[0]
if( cc.cells.length < 2){
alert("Please select atleast 2 cells")
exit()
}
for(var i = 0; i < cc.cells.length; i++){
if(i == 0)
cc.cells[i].bottomEdgeStrokeWeight = 0
else if(i == cc.cells.length - 1)
cc.cells[i].topEdgeStrokeWeight = 0
else{
cc.cells[i].bottomEdgeStrokeWeight = 0
cc.cells[i].topEdgeStrokeWeight = 0
}
}
-Manan
Copy link to clipboard
Copied
This worked. Thank you so much, Manan.