1 Reply Latest reply on Jan 31, 2016 11:45 PM by BEGINNER_X

    How to find folio order

    karthiks94217840 Level 2

      Hi all,

       

      Please suggest me, how to find out indesign cs6 files linked in folio correct order through scripting. (very urgent friends)

       

      Advanced Thanks

        • 1. Re: How to find folio order
          BEGINNER_X Level 3

          Hi Karthik,

           

          Use the below code, Report will saved in Indesign location with re folio order.

           

          
          
          
              
          
          
          
          
          var myDoc = app.activeDocument;
          
          var myFilePath = myDoc.filePath;
          
          var myDocName = myDoc.name.replace(".indd", "_report.txt")
          
          //~ alert("myDocName: " + myDocName)
          
          myArray = new Array();
          
          
          var myPages = app.activeDocument.pages;
          
          //~ alert(myPages.length)
          
          pageNumber = 0;
          
          for(i=0; i<myPages.length; i++)
          {
          
          
          
          
          var myDocumentPage = myPages[i].name;
          
          
          
          pageNumber++
          
          
          
              
             if(myDocumentPage == pageNumber)
          
          
          
          
          {
          
          
              
          continue;
          
          
              
          }
          
          
          
          else
          
          
          
          {
          
          
              
          var pageNumber = myDocumentPage;
          
          
              
          alert( "Error in Page Sequence: " + myDocumentPage + "\rReport also Generated in Document Location")
          
          
              
          myArray.push(myDocumentPage)
          
          
             
           
          
          
              
          }
          
          
          
          }
          
          
          
          
          var myTextFile = new File(myFilePath + "/" + myDocName);
          
          myTextFile.open("w")
          
          if(myArray.length ==0)
          {
          
          
          
          
          alert("No Error in Page Sequence")
          
          
          
          myTextFile.write("No Error in Page Sequence" )
          
          
          
          myTextFile.close();
          
          
          
          }
          
          
          
          else
          {
          
          
          
          
          myTextFile.write("Error in Page Sequence: " + myArray)
          
          
          
          myTextFile.close();
          
          
          
          }
          
          
          
          
          alert("Process Completed")