Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: finding cells containing numbers and applying a cellstyle.

$
0
0

guh....

just in the last month or so there were at least 3 threads on similat matters.

here is a quick and dirty one for all the document

 

 

function main() {          var doc = app.activeDocument;          app.findGrepPreferences = app.changeGrepPreferences = null;          app.findGrepPreferences.findWhat = "\\A\\d+\\Z"          var myF = doc.findGrep(),                    l = myF.length;          while (l--) {                    if (myF[l].parent.constructor.name == 'Cell') {                              myF[l].parent.appliedCellStyle = 'NameOfYourCellStyle';                              //optional clear the cell overrides, comment out next line if not needed                              myF[l].parent.clearCellStyleOverrides()                    }          }          alert('All done!\nYou can go outside an play now!')  }
app.doScript('main()', undefined, undefined, UndoModes.entireScript, 'Apply Cell Style to Nr')

Viewing all articles
Browse latest Browse all 37788

Trending Articles



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