8 Replies Latest reply on Feb 1, 2017 1:31 AM by lisaj61058814

    Change master page size – multiple documents

    lisaj61058814

      Hi there!

       

      I am searching for the easiest and fastest possibility to change the size of a master page on multiple documents. I started working with a book file and synchronized the master pages but the changes of the width and height where not adopted.

       

      Is there any other chance to handle that issue? Maybe a script?

       

      Yours, Lisa

        • 2. Re: Change master page size – multiple documents
          rob day Adobe Community Professional & MVP

          Is there any other chance to handle that issue? Maybe a script?

          Are you trying to alter the size of the master spread's pages, or the size of the document itself?

           

          The script Michael linked to is changing the document page dimensions—or all of the pages. A more complex script could change the master page size while leaving the document size unchanged. When you change the page size other factors come into play—liquid layout rule, the transformation point, which master to change or change them all...

          • 3. Re: Change master page size – multiple documents
            lisaj61058814 Level 1

            Thanks for the script, but I need to change the size of a master page. My documents includes multiple master pages and I just want to change the size of one of them.

            • 4. Re: Change master page size – multiple documents
              rob day Adobe Community Professional & MVP

              Unless it's a lot of documents the script could take longer to code than doing it manually, but you might inquire in the scripting forum

              • 5. Re: Change master page size – multiple documents
                lisaj61058814 Level 1

                There are about 120 documents but I've no experience in scripting, so I will do it manually.

                Thanks anyway.

                • 6. Re: Change master page size – multiple documents
                  rob day Adobe Community Professional & MVP

                  The script Michael linked to can be altered to only resize pages of a master spread. The script below would change the size of the pages in the first masterspread using a center transform to 7.5"x11"— change the first 2 lines to your desired dimensions in inches.

                   

                  Not knowing what your document looks like this may or may not work, but you should be careful to test it on some copies because the script opens, saves and closes the documents in the chosen folder. To test copy this code in to ExtendScript Toolkit and save with .jsx extension into your scripts folder.

                   

                   

                   

                  var w=7.5
                  var h=11
                  
                  
                  var myFolder = Folder.selectDialog("Select the Folder contains Indesign Files")   
                  var myFiles = myFolder.getFiles("*.indd") 
                       
                  for(i=0; i<myFiles.length; i++) { 
                      var mf = app.open(myFiles[i]) 
                      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT; 
                     
                      //the master spread to change
                      var myLP=app.activeDocument.masterSpreads[0].pages[0];
                      var myRP=app.activeDocument.masterSpreads[0].pages[1];
                  
                      myLP.resize (CoordinateSpaces.INNER_COORDINATES,AnchorPoint.CENTER_ANCHOR,ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,[72*w,72*h])
                      myRP.resize (CoordinateSpaces.INNER_COORDINATES,AnchorPoint.CENTER_ANCHOR,ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,[72*w,72*h])
                     
                      //saves and closes the file
                      mf.save(); 
                      mf.close();
                  } 
                  
                  1 person found this helpful
                  • 7. Re: Change master page size – multiple documents
                    Laubender Adobe Community Professional & MVP

                    Hi together,

                    I want to comment the script as well.

                    Also repeating some of the things Rob already mentioned.

                     

                    Most important:

                    The script does not backup the original files.

                    It will overwrite the original ones you are pointing at.

                    So do your backups before testing this!

                     

                    The script acts always on the first master spread shown in the Pages panel.

                    Master "None" does not count as master here.

                     

                    If you are using more than one master spreads in the documents make sure that the one you want to change is the first one in the Pages panel.

                     

                    If the master spread that should be changed is a different one than the first one—e.g. always the second master spread in the Pages panel—you can access the second one by changing the index number from 0 to 1 (counting collections or arrays with ExtendScript always start with zero):

                     

                    // Second master spread should be changed:

                    var myLP=app.activeDocument.masterSpreads[1].pages[0]; 

                    var myRP=app.activeDocument.masterSpreads[1].pages[1];

                     

                    If only one page in a master spread should be changed comment out the one you would not like to change.

                    E.g. the second page of master spread 2:

                     

                    // var myRP=app.activeDocument.masterSpreads[1].pages[1];

                    // myRP.resize (CoordinateSpaces.INNER_COORDINATES,AnchorPoint.CENTER_ANCHOR,ResizeMethods.REPLACING_CUR RENT_DIMENSIONS_WITH,[72*w,72*h]) ;

                     

                    If the master spread is always somewhere else in the order of master spreads in every InDesign document the script must be expanded to search for the right master. To write such a script could take a while and will be too much effort. Then maybe you better change the size of the master pages individually…

                     

                    Regards,

                    Uwe

                    1 person found this helpful
                    • 8. Re: Change master page size – multiple documents
                      lisaj61058814 Level 1

                      Thanks for your hints about the backup and the order of master pages! I've not tried it so far but the script sounds practicable.