Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Create New Folio

$
0
0

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:

 

Input1.png

 

Output:

 

output1.png

 

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


Viewing all articles
Browse latest Browse all 15932

Trending Articles



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