Skip to main content
Participant
June 11, 2014
Question

Is there a script to print document pages according to their master?

  • June 11, 2014
  • 1 reply
  • 258 views

I have a large document with multiple master pages in use. I often need to print only document pages that are "A" Master, "B" master, etc. Is there any way to do this, rather than entering the page numbers manually?

This topic has been closed for replies.

1 reply

Chinnadk
Legend
June 12, 2014

Hi,

Try this.

var doc = app.activeDocument, pages = doc.pages, PageNumbers = "";

for(var i =0;i<pages.length;i++)

{

        if(pages.appliedMaster.namePrefix == 'A')

        {

                PageNumbers += pages.name + ",";

            }

    }

app.pdfExportPreferences.pageRange = PageNumbers;

doc.exportFile(ExportFormat.PDF_TYPE, new File(doc.fullName.toString().replace(/\.indd$/i,".pdf")), false);

Regards,

Chinna

natmytypeAuthor
Participant
June 12, 2014

Thank you so much...um, how do I get it to work? I'm pretty new at using scripts. :-)