2 Replies Latest reply on Aug 7, 2016 9:42 PM by Laubender

    How do I test if a page is a single page or [the right] part of a spread?

    Schmaltzkopf

      Hi, there.

      I am trying to write a script that acts one way if the page is a single page, and a different way if it is part of a spread. How do I determine if it is a single page or part of a spread?

       

      Any help is appreciated.

      Thank you.

        • 1. Re: How do I test if a page is a single page or [the right] part of a spread?
          Trevorׅ Adobe Community Professional

          Hi

           

          A single page is also part of a spread, a single paged spread.

           

          To answer your question you can see if there's more pages in the spread which is the parent of the page. If's there's only one page in the spread then it's a single page spread.

           

          isSinglePageSpread = myPages.parent.pages.length === 1;

           

          HTH

           

          Trevor

          • 2. Re: How do I test if a page is a single page or [the right] part of a spread?
            Laubender Adobe Community Professional & MVP

            Do you plan to know where a page is in the printed, bound and folded document?

            Or do you like to know where the page is positioned in the document relative to the spine?

             

            Some cases below.


            Every line is a spread.

            Every number is a page number in the order of the document:

            documentOffset + 1

             

            A. Facing pages document, pageBinding LEFT_TO_RIGHT

             

              | 1
            2 | 3

            4 | 5

             

            B. Facing pages document, pageBinding RIGHT_TO_LEFT

             

            1 |

            3 | 2

            5 | 4

             

            C. Facing pages, pageBinding LEFT_TO_RIGHT with fold out

             

                    | 1

                  2 | 3

                  4 | 5 - 6

            7 - 8 | 9

              10 | 11

                  …

             

            D. Non-facing pages document

             

            1

            2

            3

             

            E. Non-facing pages document ( one spread ):

             

            1-2-3-4

             

            D. Non-facing pages document where pages are moved ( one spread ):

            4-1-2-3

             

            There are more variations possible.

             

            First check, if there is a spine:

             

            app.documents[0].documentPreferences.facingPages
            

             

            will return true or false

            If false, there is no spine => non-facing pages document.

             

            Then check, if the pages order is LTR or RTL:

             

            app.documents[0].documentPreferences.pageBinding
            /* 
            Can return:
            DEFAULT_VALUE
            LEFT_TO_RIGHT
            RIGHT_TO_LEFT
            */
            

             

             

            Regards,
            Uwe