2 Replies Latest reply on May 16, 2018 12:40 PM by VeluVK

    find table bottom border with empty cells

    VeluVK Level 1

      Any one help me for the below condition.

       

      Find table bottom border with empty cell

       

      if(cell[j].contents == "" && cell[j].bottomEdgeStrokeType == "Thick - Thick" && cell[j].bottomEdgeStrokeType=="Solid")

       

       

      Regards

       

      Velu

        • 1. Re: find table bottom border with empty cells
          Loic.Aigon Adobe Community Professional

          if(

               cell[j].contents == ""

               && //AND

               (

                    cell[j].bottomEdgeStrokeType == "Thick - Thick"

                    ||  //OR

                    cell[j].bottomEdgeStrokeType=="Solid")

               )

          )

           

          • 2. Re: find table bottom border with empty cells
            VeluVK Level 1

            Hi Loic,

             

            Thanks for the script.

             

            I need your help in this below scripts.  I just tried below one but I didn’t get any output.

             

             

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

             

            for (s=0; s<app.activeDocument.stories.length; s++) 

                { 

                    for (t=0; t<app.activeDocument.stories[s].tables.length; t++) 

                    { 

                        app.activeDocument.stories[s].tables[t].select();

                        var sel = app.activeDocument.selection[0];   

                        if(sel instanceof Table)   

                        {   

                            var col = sel.columns;   

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

                            {   

                                var cell = col[i].cells 

                                for(var j=0;j<cell.length;j++)   

                                {   

                                    if(cell[j].contents == "" && cell[j].bottomEdgeStrokeType == "Thick - Thick") //add your conditions here like double spaces, double non breaking space etc.. 

                                        {

                                            cell[j].insertionPoints[0].contents = " "

                                            cell[j].texts.everyItem().appliedCharacterStyle = "DoubleLine";  

                                         }

                                          else if(cell[j].contents == "" && cell[j].bottomEdgeStrokeType == "Solid")

                                          {

                                          cell[j].insertionPoints[0].contents = " "

                                          cell[j].texts.everyItem().appliedCharacterStyle = "SingleLine";  

                                          }                     

                                }

                            } 

                        } 

                    } 

                }

             

             

             

            Requirement:

             

            1. Need to apply “DoubleLine” character style for the cells with “Thin-Thin” bottom border
            2. Need to apply “SingleLine” character style for the cells with “Solid” bottom border
            3. Need to insert “single space” for empty cells only with Thin-Thin & Solid borders.

             

             

            Regards,

            Velu