with the following command in the master page object style (AA1) I'm active
var d = app.activeDocument; function myFindObjStyle(a) { var x, i; for(i = 0; i < a.length; ++i) { if(i == a.length - 1) { x = (x ? x : d).objectStyles.item(a[i]); if(!x || !x.isValid) return null; } else { x = (x ? x : d).objectStyleGroups.itemByName(a[i]); if(!x || !x.isValid) return null; } } return x.isValid ? x : null; } function paragraphByNesneStilWp(stil) { var tests = [], i, j, it, p, finded; for(i = 0; i < d.pages.length; ++i) { p = d.pages.item(i); if(p && p.isValid) { pi = p.pageItems; finded = false; for(j = 0; j < pi.length; ++j) { it = pi[j]; if(it && it.appliedObjectStyle == stil) { finded = true; tests.push({pr: it, sn: i}); break; } } if(!finded) { pi = p.masterPageItems; for(j = 0; j < pi.length; ++j) { it = pi[j]; if(it && it.appliedObjectStyle == stil) { tests.push({pr: it.override(p), sn: i}); break; } } } } } return tests; } var FobjectStyle, objectss; FobjectStyle = myFindObjStyle(["AA1"]); if(!FobjectStyle) { alert("no style"); } objectss = paragraphByNesneStilWp(FobjectStyle);
I want that my
two pages increasing (Exercise - 1 Exercise - 1 Exercise - 2 Exercise - 2 ...)
as the picture
Can I place into the script