Hi All,
I need to create a new folio for my document.
Note: Folio text frame label as "FOLIO"
1. Take folio from the Numbering and Sections
2. Update to the first(recto) page
3. Same folio comes to the verso page
4. Again add +1 number to the recto page
5. same like as for all pages
Screenshot helps you for better clarifications,
Input:
Output:
Trying Code:
var myDoc = app.activeDocument; var myPages = app.activeDocument.pages; alert(myPages.length); myCounter = 0; for(p=0; p<myPages.length; p++) { myCounter++ if(myPages[p].documentOffset % 2 == 1) { var myTF = myPages[p].textFrames.everyItem().getElements(); for(t=0; t<myTF.length; t++) { if(myTF[t].label == "FOLIO") { myTF[t].contents = String(myCounter) } } } //if condition closing else { var myTF = myPages[p].textFrames.everyItem().getElements(); for(t=0; t<myTF.length; t++) { if(myTF[t].label == "FOLIO") { myTF[t].contents = String(myCounter) } } } //else closing } //for loop closing
Kindly help for my request.
Regards
Siraj