3 Replies Latest reply on Dec 31, 2016 11:52 AM by abhijeett89122812

    Setting table properties with help of scripts

    abhijeett89122812 Level 1

      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...

        • 1. Re: Setting table properties with help of scripts
          abhishekp91499535 Level 1

          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;

          • 2. Re: Setting table properties with help of scripts
            abhishekp91499535 Level 1

            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

            1 person found this helpful
            • 3. Re: Setting table properties with help of scripts
              abhijeett89122812 Level 1

              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!!!