10 Replies Latest reply on Aug 1, 2014 6:46 AM by Mrtreebis

    Display page size

    Mrtreebis

      Hi, can anybody help me - at my agency when we create an ad/mailer etc in InDesign, we then drag in an InDesign library object to the slug area at the bottom of the page which displays the creation date, and file name, using text variables. But I can't find a way to automatically pull in the page size (height x width in mm). From what I've read I need to be looking at scripts, but don't know enough to create it myself - does anybody know of a script that can be applied to that text frame of the library object?? Many thanks in advance.

        • 1. Re: Display page size
          Chinnadk Level 4

          Hi,

           

          Create a textvariable named "PageSize" type should be "Custom Text", add it to the Indesign library object and run this script.

           

          var doc = app.activeDocument;
          doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.millimeters;
          doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters;
          var w = doc.documentPreferences.pageWidth,
              h = doc.documentPreferences.pageHeight,
              pagesize = app.activeDocument.textVariables.itemByName("PageSize");
          pagesize.variableOptions.contents = w + " mm X " + h + " mm";
          

           

          Regards,

          Chinna

          • 2. Re: Display page size
            Jump_Over Level 5

            Hi,

             

            Just in case...

            Since predefined library object is going to mix with a script action - maybe a better solution is to do a job by script from the beginning to the end?

             

            advantages:

            • one action involved by keyboard shortcut
            • possible to manage various page's sizes in the sam doc
            • open to include other (many?) infos

            disadvantages:

            • this script does not exist (?) yet

             

            Jarek

            • 3. Re: Display page size
              Luc Lorent Level 1

              Watch out for pages of whom the page size has been changed.

              The width and height of the document preferences are different from the actual page size in that case.

              • 4. Re: Display page size
                Mrtreebis Level 1

                Many thanks for such a quick reply Chinnadk - have tried this and seems to work - really appreciate your help. The measurements shown seem to have a lot of decimals after though??

                • 5. Re: Display page size
                  Mrtreebis Level 1

                  Luc Lorent - yes I agree, we do sometimes change the page size independently to the document setup, so in that case we could then be displaying the wrong info - is there a way to change it to display page size instead?

                  The other concern i would have is that the "PageSize" text variable is only updated on running the script (things such as file name update automatically) so if we amended the size, and forgot to run the script, there is a danger we could be passing on the wrong info. Don't know if this is achievable!?

                  • 6. Re: Display page size
                    Mrtreebis Level 1

                    Hi Jump_Over - yes i had wondered about whether that was a better option instead of trying to work with the existing library item - throwing out the challenge then to anyone interested!!!?

                    Thanks for everyones input.

                    • 7. Re: Display page size
                      Mrtreebis Level 1

                      Many thanks for such a quick reply Chinnadk - have tried this and seems to work - really appreciate your help. The measurements shown seem to have a lot of decimals after though?? (instead of 210x297 displays 209.999999999936 mm X 296.999999999461 mm) Do you know how i would change it please!?

                      • 8. Re: Display page size
                        Mrtreebis Level 1

                        Luc Lorent - yes I agree, we do sometimes change the page size independently to the document setup, so in that case we could then be displaying the wrong info - is there a way to change it to display page size instead?

                        The other concern i would have is that the "PageSize" text variable is only updated on running the script (things such as file name update automatically) so if we amended the size, and forgot to run the script, there is a danger we could be passing on the wrong info. Don't know if this is achievable!?

                        • 9. Re: Display page size
                          Mrtreebis Level 1

                          Hi Jump_Over - yes i had wondered about whether that was a better option instead of trying to work with the existing library item - throwing out the challenge then to anyone interested!!!?

                          Thanks for everyones input.

                          • 10. Re: Display page size
                            Mrtreebis Level 1

                            Apologies about the duplicate replies - new to this!