4 Replies Latest reply on Aug 3, 2016 11:56 PM by Laubender

    How to return name of page

    jsvor6

      I have been working at this for a few days and I don't know what I'm missing. I have a document that has 8 pages.  The pages are named C1, C2, C3, C4,...etc.  How can I return the actual page names (C1) and not just the page numbers (1)?  I am trying to export each page as a separate PDF with the page name included in the filename.  Any help would be most welcomed.

        • 1. Re: How to return name of page
          BarbBinder Adobe Community Professional
          How can I return the actual page names (C1)

          I'm not clear what you are asking for. Do you want to return the page names to just numbers? In that case, you would remove the prefix from the Section and Numbering Options.

          InDesign CCss_014.png

          I am trying to export each page as a separate PDF with the page name included in the filename.

          You could a.) export one pdf and break it up into 8 pages (and rename them) in Acrobat or b.) use a script: Exporting individual pages to PDF / Indesign

          • 2. Re: How to return name of page
            jsvor6 Level 1

            Thanks Barb.  You got me on the right track.  I am scripting this to try to return the page name and not just the page number.  Your screenshot helped me out - I totally forgot about the "Include Prefix when Numbering Pages".  Now that it is checked when I return the Page.Name it is showing "C1" which is what I was trying to get.

            • 3. Re: How to return name of page
              BarbBinder Adobe Community Professional

              Awesome! Glad you are back on track.

              • 4. Re: How to return name of page
                Laubender Adobe Community Professional & MVP

                Hi together,

                as I read the title of the thread I was wondering what exactly is meant by "return" in "return name of page".

                In scripting speak "returning something" has a different meaning than "return to some former state".

                When a programmer asks what is "returned" usually it is meant, that a function would give something back. A result.

                 

                In this case the OP wanted to read out the full name of a page, that can be a single string of characters like "1". That's not a number. It is a name.

                 

                "Include Prefix when numbering pages" makes a difference here.

                Not in the UI when the page names are visible as "C1" in the Pages Panel, but by scripting when a page is asked for its name:

                 

                [  ]"Include Prefix when numbering pages" => page.name is "1"

                [x]"Include Prefix when numbering pages" => page.name is "C1"

                page.documentOffset => 0 * ( if the page is the first page in the document; and here a number is returned )

                 

                // EDIT: With ExtendScript numbering begins with 0 , VB-Script numbering can begin with 1 .

                 

                Regards,
                Uwe