3 Replies Latest reply on Apr 12, 2012 8:26 AM by Net & Storage Solutions

    Get Object for position

    Net & Storage Solutions



      My question is rather simple,


      is there any functionality that returns an object by x and y pos?


      E.g. I click on 120x and 250y, and on that coördinate there is a textframe,

      is it possible to fetch that object just by giving the x and y ?


      (Via scripting, or java, whatever is possible)


      Kind regards

        • 1. Re: Get Object for position
          Manish-Sharma Employee Moderator

          This feature is not present in the Indesign, may be some script can do it for you...

          • 2. Re: Get Object for position
            [Jongware] Most Valuable Participant

            Scripting can't help you, because a script cannot determine if the user clicked anywhere, lest on what position.


            (A crude way to do this would be to pop up a dialog, asking for the coordinates. If the coordinates are known, it's easy to get a list of objects that are under that position. But note: objects, plural. As always, this has to be thought about ahead. The OP only mentions 'an object'; what if there are more than one? What about a group -- return the group itself, or "the" object (or objects) inside the group? What about items on a master page?


            As always, it would help if the OP could clarify what would be done with the object(s) after 'finding' them at a certain location. Surely this would serve a deeper purpose, other than "just to see what is there"?)

            • 3. Re: Get Object for position
              Net & Storage Solutions Level 1

              Well I know how to get the input done,


              I just don't know how to get the object or objects under that position. So that is my biggest question.

              After I know that I will figure out how to deal with the return(s) I will get.


              E.g if I get an object that contains another object and then a textframe, I would handle upon that.
              Same goes if I encounter another kind of frame or object.


              Thanks in advance!