Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Excluding MasterPage Items from JPG export script

Return to Member Forum

  • Author
    Posts
    • #114046

      Hi,

      I have a code that exports all the TextFrames as JPG on the active document. The problem is, the calculation method i use does INCLUDE the MasterPage items as well as spreads. Let’s say I have 30 textframes I want to export, but masterpage has 4 that includes titles and page numbers etc. The calculation method shows 34 and screws something up eventually even though they are locked and don’t get exported.

      Here is my code, how can i make this code work for PAGES ONLY?

      var myDoc = app.activeDocument;
      var myFolder = myDoc.filePath;
      var myImage = myDoc.textFrames;
      var PromFolder = new Folder(myFolder+”/”+app.activeDocument.name+”_”+”Promethean”);

      if (!PromFolder.exists)
      PromFolder.create();

      var ToplamSoru = 0 ;

      for (var i=0; myImage.length>i; i++)
      {
      app.select(myImage[i]);
      ToplamSoru = ToplamSoru +1;
      }

      var Cevapli = (ToplamSoru);
      alert(Cevapli);

      app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.maximum;
      app.jpegExportPreferences.exportResolution =50;

      for (var i=0; myImage.length>i; i++)
      {
      if ( i <= Cevapli)
      {
      if( i < 9)
      {
      app.select(myImage[i]);
      var SoruNo = myImage[i].contents.substring(1,2);
      app.selection[0].exportFile(ExportFormat.JPG, File(PromFolder+”/”+SoruNo+”.JPEG”), false);
      // alert(i);
      }
      else
      {
      app.select(myImage[i]);
      var SoruNo = myImage[i].contents.substring(1,3);
      app.selection[0].exportFile(ExportFormat.JPG, File(PromFolder+”/”+SoruNo+”.JPEG”), false);
      //alert(i);
      }
      }
      alert (“Done”)
      }

      Thanks,

Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Forum Ads