2 Replies Latest reply on Mar 25, 2015 3:38 AM by Tomooo

    How to remove stroke from cells?

    Tomooo

      Hi!

      I have 60 pages worth of tables. I want to remove black strokes appearing on the bottom of some orange filled cells. I use 5 cell styles. One is "no fill, stroke", and other four have "fill (gradients of a single colour), no stroke"

      I presume that I need all cells that are not white to have theire cell styles re-applyed.

       

      What would script for something like that look like?

       

      Thanks in advance.

       

      TScreen Shot 2015-03-19 at 15.14.50.jpg

        • 1. Re: How to remove stroke from cells?
          tanujad54435002 Level 1

          Hi,

           

          You can try following script to remove stroke for filled cells.

           

          var totalTxtframes = app.activeDocument.textFrames;

          for(var i = 0; i< totalTxtframes.length; i++)

              {

                  if(totalTxtframes[i].tables.length >0)  // if the textframe has table

                      {

                          var tbl = totalTxtframes[i].tables;

                          for(var j=0; j< tbl.length; j++)  // A textframe can have one or more than 1 table, hence using for loop to traverse each table one by one

                              {

                                  var allCells = tbl.item(j).cells;

                                  for(var k = 0; k< allCells.length; k++)  // traverse each cell in order to change its properties

                                      {

                                          var cellInfo = allCells[k]

                                          if("None" != cellInfo.fillColor.name)  // if cell background is not equal to No Fill then stroke weight = none

                                            {

                                              cellInfo.bottomEdgeStrokeWeight = 0;

                                              cellInfo.topEdgeStrokeWeight = 0;

                                              cellInfo.leftEdgeStrokeWeight = 0;

                                              cellInfo.rightEdgeStrokeWeight = 0;

                                            }

                                      }

                             }

                       } 

              }

          • 2. Re: How to remove stroke from cells?
            Tomooo Level 1

            Thanks , works like a charm.