13 Replies Latest reply on Nov 18, 2008 7:58 PM by (3poulakia)

    CS3 strange order with LabelGraphics.jsx

    Level 1
      Hi all,

      I am experiencing a strange behavior with LabelGraphics.

      I can not figure how to make the script use a defined list in conjunction with a paragraph style to properly number the images from the beginning of the document downwards (or even continue across an InDesign book).

      Any ideas?
      Thanx in advance
      Michael
        • 1. Re: CS3 strange order with LabelGraphics.jsx
          Loic.Aigon Adobe Community Professional
          Could you please be a little bit clearer ? I can't see what you mean.
          Loic
          • 2. Re: CS3 strange order with LabelGraphics.jsx
            Level 1
            hi loic,

            1. I created a numbered list under type->bulleted and number lists with: mylist/continue numbers across story - and - continue numbers from previous doc in book.
            2. I created a paragraph style myparagraph with options: bullets and numbering/numbers/mylist/level=1/format= 1,2,3/image./mode=continue from previous #
            3. I run the script in indd with 10 images: LabelGraphics(mod)/Label Type=XMP Description/Style=myparagraph style
            4. I expect: image. # + the label with numbers running from 1-10, starting from page 1(1,2,3,4imgs),page 2(4imgs=5,6,7,8) ,page 3(2imgs=9,10), image 1 + the label going all the way to last page, image 10 + the label, being the last one appearing on the indd

            I get: image. # + the label with numbers running from 1-10, BUT page 1(2,1,4,3imgs),page 2(4imgs=8,7,6,5) ,page 3(2imgs=10,9)

            It starts numbering each page from the bottom up.Don't know why.
            I hope this is enlightening

            Michael
            • 3. Re: CS3 strange order with LabelGraphics.jsx
              Level 1
              Hi Michael,

              I don't get this behavior--once I've set up the paragraph style to number the paragraphs, I get the numbering order I expect (top to bottom, left to right). Does paragraph numbering work correctly for other paragraphs? Are you using InDesign ME?

              Thanks,

              Ole
              • 4. Re: CS3 strange order with LabelGraphics.jsx
                Level 1
                Sorry Olav,
                but, what is inDesign ME?
                • 5. Re: CS3 strange order with LabelGraphics.jsx
                  Level 1
                  Hi Michael,

                  ME = "Middle Eastern"--I was asking because that version features right-to-left binding, and I was wondering if that might have some effect on paragraph numbering.

                  Thanks,

                  Ole
                  • 6. Re: CS3 strange order with LabelGraphics.jsx
                    Loic.Aigon Adobe Community Professional
                    Hi Michael,
                    ME is for Middle East, I guess you will know if you had it :-)
                    Regarding to your script, with Olav on the topic, you are in good hands ;-)
                    Loic
                    • 7. Re: CS3 strange order with LabelGraphics.jsx
                      Level 1
                      Hi Olav,

                      I created new file, different 12 images and get:

                      page 1(3,1,2 imgs),page 2(4imgs=7,6,5,4) ,page 3(2imgs=9,8), page 4(2imgs=1,10) ,page 5(1imgs=1)
                      • 8. Re: CS3 strange order with LabelGraphics.jsx
                        Level 1
                        Hi loic,
                        I do not think I use ME, but the language is set to Greek and the descriptions are in Greek.

                        And scripting is all Greek to me.

                        Thanx,
                        Michael
                        • 9. Re: CS3 strange order with LabelGraphics.jsx
                          Level 1
                          Hi all,

                          This topic is NOT SOLVED.

                          To sum it up (CS3/MAC).

                          i 1. LabelGraphics numbers my images the wrong way: right2left/bottom2top. Furthermore this is not consistent

                          i 2. I do not use inDesign ME edition

                          i 3. The language in use is Greek

                          i 4. Could it run and how through an indesign book?

                          If anyone could help I would be gratefull.
                          Michael
                          • 10. Re: CS3 strange order with LabelGraphics.jsx
                            Level 1
                            Hi Michael,

                            I've looked into it, and, again, this has nothing to do with the script. The problem is in the way that InDesign applies numbering to paragraphs in unlinked frames. This is true for any frames, not just the ones created by the script. InDesign numbers frames on a page in *creation* order--not from top left to bottom right (as most of us would expect). I think this is a bug, or, at the very least, a design flaw.

                            You can correct the numbering order by linking the text frames on the page in the order in which you want the numbers to appear, or you can spend some time copying/pasting frames until you get the order you want.

                            Thanks,

                            Ole
                            • 11. Re: CS3 strange order with LabelGraphics.jsx
                              Level 1
                              Hi Michael,

                              You could change the line:

                              for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){
                              

                              To:
                              for(var myCounter = myGraphics.length-1; myCounter >= 0; myCounter--){
                              

                              To reverse the order in which the script crates the label frames, but that still doesn't guarantee that the paragraphs will be numbered correctly--that depends on the order in which the graphics were placed.

                              Hope this helps, even a little!

                              Thanks,

                              Ole
                              • 12. Re: CS3 strange order with LabelGraphics.jsx
                                Loic.Aigon Adobe Community Professional
                                Hi 3poulakia,
                                I admit that seeing olav turning around, I let my seat to someone really deeply much more skilled than me. I presumed the answer that Olav has given to you (ie index defined by order of creation) but once again as I am not a pro, I didn't want to tell you silly things.
                                One thing we can do maybe is cheating. I mean, we can reorder the frames accordingly to their bounds. Hence the highest frame geometrically speaking has to be index [0] and the lowest has to become index [-1] (or last one if you prefer).
                                That way running LabelGraphics should render you perfect order in any situations. Could be a sub function from the script LabelGraphics by the way.
                                Loic
                                • 13. Re: CS3 strange order with LabelGraphics.jsx
                                  Level 1
                                  to Olav,

                                  Thanx for letting me realise that it is not a problem from my side. I went on and tried the change you suggested and it worked as you predicted. It does not give consistent results. I gets all mixed up when I had more than 3 images on a page.

                                  to loic,

                                  I think that scripting is about cheating. You get to execute mountainous tasks with just one click. I can fully understand your way of thinking. I do not think I could reorder the paragraphs or relink the text frames since I work with long documents in autoflow (chapters of 50+ pages)
                                  The way I see it it would have to be one of two ways.
                                  Either 1. A topleft - bottomright approach, or
                                  2. A gravity like approach. This way the script would "hit" the highest on the page image going to the lower and so on.
                                  So could you please elaborate on your solution? And when I say elaborate I mean provide the copy/paste I would have to apply since I do not know scripting?
                                  It would be great if it worked.

                                  Thanx to both
                                  Michael