6 Replies Latest reply on Sep 17, 2014 5:01 AM by KeithGilbert

    Auto naming logic for ID graphic objects

    KeithGilbert Level 1

      Can anyone tell me what logic is used for the naming of JPG/PNG images that are generated for InDesign-drawn boxes, line, ovals, groups, etc?

       

      In other words, if you draw a circle in InDesign, anchor this to the text, output as reflowable EPUB, unzip the EPUB, and look in the oebps\image folder, you'll see an image named something like 2022.jpg. I'm trying to determine the logic behind this naming, as I need to reuse these images for something else.

        • 1. Re: Auto naming logic for ID graphic objects
          Douglas.Waterfall Adobe Employee

          Okay, Keith, I'll make a trade with you - I will tell you how we do it, and you tell me what you are trying to do with this information.

           

          The filename comes from the unique object identifier (we call it a UID) of the object being rasterized. Since each object has a unique UID we are guaranteed that we will not have a filename conflict.

           

          I would caution you to not depend on this, though this remains true even in the upcoming update, because it has been suggested that naming things based on their source page number (plus the UID) might be more helpful to developers who are trying to make sense of what went where. Whether that will actually occur going forward I have no control over at this point, sadly.

           

          Douglas

          • 3. Re: Auto naming logic for ID graphic objects
            TᴀW Adobe Community Professional & MVP

            Hi Douglas,

             

            Is the UID the same as the object ID that is exposed to scripting? E.g.,

            if I run this in the ESTK

             

            app.selection[0].id

             

            (given some object being selected in the UI), is that the same number as

            the UID?

            • 4. Re: Auto naming logic for ID graphic objects
              KeithGilbert Level 1

              Thank you Douglas. This is really helpful.

               

              Here is what I need this for: I've got a large scripting project where a health care client has 2500+ ID files that are very regular in their layout, structure, use of styles, etc. They need to get the content from these documents, along with the simple layout (h1, h2, h3, body, etc) into various CMS. Some of the CMS ingest HTML, some XML, etc. I've written a series of scripts that help a user quickly check/cleanup/"normalize" a document, and then export to html/xml per the specifications of the CMS.

               

              For various reasons, I'm using InDesign's HTML export engine as the starting point, so it creates a "web-resources" folder and dumps the images in there. We need to dump the images that are generated from each document's export into a common images folder. We can be guaranteed that the placed image filenames are unique. But it looks like the auto-generated filenames from the UID will not likely always be unique, so I'll probably add a timecode or something to the filename to ensure that it is unique.

               

              This is a very unique and challenging project. I'm having fun with it.

              • 5. Re: Auto naming logic for ID graphic objects
                Laubender Adobe Community Professional & MVP

                @Keith – ah, interesting…

                 

                You wrote: "But it looks like the auto-generated filenames from the UID will not likely always be unique…".
                Could you elaborate on this?

                 

                UIDs derived from pageItem.id should be unique regarding the scope of a single document at a given point in time. At least that's my experience with ExtendScript.

                 

                Uwe

                • 6. Re: Auto naming logic for ID graphic objects
                  KeithGilbert Level 1

                  @Uwe, Sorry, what I meant is that the auto-generated filenames from the UID will not be unique across a large group of documents. We'll be dumping all the images from 3000 documents into a single folder, so the names must be unique. I've pre-pended the unique filename to each image file name, so this should ensure that they are unique.

                   

                  Thanks,

                  Keith