8 Replies Latest reply on Mar 22, 2016 2:33 AM by karthiks94217840

    How to add tag for applied paragraph style.

    karthiks94217840 Level 2

      Dear script kings,

       

      I was workout the script for based on the table (xml workflow).

       

      I was done the script automatically apply paragraph style in the table. below my coding.

       

      allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
       for (aTable=0; aTable<allTables.length; aTable++)
      {
                 var myTable = allTables[aTable];
                 
                  if(myTable.rows.length >1)
                  {
                        myTable.autoTag(); 
                        for (rw=0; rw<myTable.rows.length; rw++)
                        {
                            if(rw==0)
                            {
                              myTable.rows[rw].cells.everyItem().paragraphs[0].appliedParagraphStyle ="Table head";
                              }
                          else
                          {
                              myTable.rows[rw].cells.everyItem().paragraphs[0].appliedParagraphStyle ="Table Text";
                              }
                        }
                   }
      }
      

       

      This working fine.

       

      @ I needed; How to add xml tagging <p> in the paragraph styles for "Table head" and "Table Text"? This is possible to script. please help and suggest me dear friends.

       

      Advance Thanks all.