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')