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

Need to select ALL tables

Community Beginner ,
Nov 16, 2015 Nov 16, 2015

Copy link to clipboard

Copied

Hi,

I import Word documents in InDesign CC, wich contains several tables.

I need to select ALL tables and then change the size of the text inside the cells and I need to change the table strokes inside and the table-border.

I know how to install a script in InDesign – though I have not yet tried to work with a script ...

... hope my first time will be succesfull :-))))

Hope that somebody can help me.

Regards,

Pia (graphic designer)

TOPICS
Scripting

Views

2.6K

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
Guide ,
Nov 17, 2015 Nov 17, 2015

Copy link to clipboard

Copied

hi..

try this

change the values as your requirement:

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().paragraphs.everyItem().pointSize = "3pt";

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().topInset = "3pt";

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().bottomInset = "3pt";

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().leftInset = "3pt";

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().rightInset = "3pt";

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().bottomEdgeStrokeWeight = "0.5";

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().topEdgeStrokeWeight = "0.5";

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().leftEdgeStrokeWeight = "0.5";

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().rightEdgeStrokeWeight = "0.5";

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 ,
Nov 17, 2015 Nov 17, 2015

Copy link to clipboard

Copied

It works :-)))))) thanks to you I just run my first script ever :-)))))

Looking forward to changing the sizes.

You are awesome – thanks a million :-))))) and have a great day.

Regards,

Pia

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
Guide ,
Nov 17, 2015 Nov 17, 2015

Copy link to clipboard

Copied

Hey Pia,

Which size need to change?

Also please give correct answer if it works fine.

Have a nice day

karthi

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 ,
Nov 18, 2015 Nov 18, 2015

Copy link to clipboard

Copied

Hi Karthi

By sizes I mean the text-pt-sizes and the stroke-sizes (the blue text) :-))

I have one problem though – the table bottomEdgeStroke is different from table to table. Ex. in a 4 row table I may only need a stroke on the bottomEdgeRIGHT row. Other times 3 rows or 2 rows.

Think that the solution may bee a script that SELECTS ALL TABLES and then I can apply an InDesign TableStyle?

Is that possible?

--

Sorry – I thought I gave a correct answer above :-))) your script still works fine :-))))

You solved the problem I had :-)))

Regards,

Pia

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
Guide ,
Nov 18, 2015 Nov 18, 2015

Copy link to clipboard

Copied

Hi Pia,

Try this below script. It will ask you the values (take as points) to change. I don't think table style give solution.

//changing measurement as points

app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.POINTS;

app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.POINTS;

var myText=prompt("PLEASE ENTER YOUR TEXT POINT SIZE","")

var myStroke=prompt("PLEASE ENTER YOUR TABLE STROKE VALUE","")

var myBottomStroke=prompt("PLEASE ENTER YOUR TABLE BOTTOM STROKE VALUE","")

//changing text point size

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().paragraphs.everyItem().pointSize = myText;

//changing text stroke size

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().bottomEdgeStrokeWeight = myBottomStroke;

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().topEdgeStrokeWeight = myStroke;

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().leftEdgeStrokeWeight = myStroke;

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().rightEdgeStrokeWeight = myStroke;

Please let me know if this is fine.

Note: i removed the inset value coding, hope you don't require that.

Regards,

Karthi

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
New Here ,
Apr 29, 2016 Apr 29, 2016

Copy link to clipboard

Copied

Hi,

  I have same issue to select all the tables. I don't need to change table styles ,But need to select all the tables simultaneously. How to do tat? I need like,

app.activeDocument.stories.everyItem().tables.everyItem().getElements().select();

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
Guide ,
Apr 29, 2016 Apr 29, 2016

Copy link to clipboard

Copied

see this thread..hope this is useful

Select table using script

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
New Here ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

Hello, I am new to scripts so sorry if this is super basic. I learned how to install them but how do I download what you have shared here? Is there a place I can copy and paste it or download this script?

Thanks

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 ,
Nov 20, 2018 Nov 20, 2018

Copy link to clipboard

Copied

LATEST

Hi Whitney,

Refer the following link to understand how to copy and execute the code

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-po...

-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