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

Setting table properties with help of scripts

Participant ,
Dec 21, 2016 Dec 21, 2016

Copy link to clipboard

Copied

I have of 400 to 500 tables in indesign file, I have to set  below properties for tables

  and row width

is there any way to save such table properties and can be used to other tables or any script for the same...

thanks in advance...

Views

450

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
Guest
Dec 22, 2016 Dec 22, 2016

Copy link to clipboard

Copied

yes you can do this easily.

define paragraph style with name "Paragraph Style 1" and character style using script or manually.

to apply this property in all table use

var doc = app.activeDocument;

var cellStyle = doc.cellStyles.add({name:"newCellStyle",appliedParagraphStyle : "Paragraph Style 1"})

doc.textFrames.everyItem().tables.everyItem().cells.everyItem().appliedCellStyle = cellStyle;

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
Guest
Dec 22, 2016 Dec 22, 2016

Copy link to clipboard

Copied

var doc = app.activeDocument;

var paraStyle = doc.paragraphStyles.add({name: "newParaStyle"});

with(paraStyle)

{

    pointSize= 7;// for font size

    justification = Justification.LEFT_ALIGN;

    leftIndent = "0.5 mm";

    rightIndent = "0.5 mm"

}

var cellStyle = doc.cellStyles.add({name:"newCellStyle",appliedParagraphStyle : paraStyle});

var tableStyle = doc.tableStyles.add({name: "newTableStyle"});

with(tableStyle)

{

    bodyRegionCellStyle = cellStyle

    headerRegionCellStyle = cellStyle

}

doc.textFrames.everyItem().tables.everyItem().appliedTableStyle = tableStyle;

doc.textFrames.everyItem().tables.everyItem().rows.everyItem().width = 50;//here you can specify your width

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
Participant ,
Dec 31, 2016 Dec 31, 2016

Copy link to clipboard

Copied

LATEST

Thanks, it is working but i want to change cell properties and row hieght of tables also

font size 7 and leading 8

and cell properties

and row hieght

Thanks in advance!!!

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