• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Indesign Script: Change the center border of two rows of selected cells

Community Beginner ,
Jul 27, 2022 Jul 27, 2022

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.

 

image.psd.jpg

TOPICS
How to , Scripting

Views

166

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 28, 2022 Jul 28, 2022

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

Votes

Translate

Translate
Community Expert ,
Jul 27, 2022 Jul 27, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 27, 2022 Jul 27, 2022

Copy link to clipboard

Copied

Thank you so much. This worked like a charm.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 27, 2022 Jul 27, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2022 Jul 28, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

LATEST

This worked. Thank you so much, Manan.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines