Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 87158

Re: A script to apply cell style to entire rows containing a specific text

$
0
0

Hi,

 

Try this,

 

var doc = app.activeDocument,     _tables = doc.stories.everyItem().textStyleRanges.everyItem().getElements(),     i, j, k, l, a, _rows,_cells, rowlen; 

for(i =0;i<_tables.length;i++) 
{     for(j =0;j<_tables[i].tables.length;j++)     {         _rows = _tables[i].tables[j].rows;         for(k =0;k<_rows.length;k++)         {             _cells = _rows[k].cells;             for(l =0;l<_cells.length;l++)             {                 if(_cells[l].contents == "someText")                 {                     rowlen = _cells[l].parent.cells.length;                     while(rowlen--)                     {                           _cells[rowlen].appliedCellStyle = doc.cellStyles.item("cellStyle01");                         }                     }                 }             }         }      }

 

Regards,

Chinna


Viewing all articles
Browse latest Browse all 87158

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>