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)
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";
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
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
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
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
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();
Copy link to clipboard
Copied
see this thread..hope this is useful
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
Copy link to clipboard
Copied
Hi Whitney,
Refer the following link to understand how to copy and execute the code
-Manan