2 Replies Latest reply on Nov 10, 2008 5:42 AM by (WellerUK_work)

    Create Page Item on Specific Page/Position

      Hi

      This is how I create new rectangle:

      ...
      mySpecs = {
      appliedObjectStyle: myobjectStyle,
      geometricBounds: myBounds,
      label: "FrameFG"
      }

      myBox = app.activeDocument.rectangles.add(myLayer, mySpecs);
      ...




      Unfortunately this always results in a rectangle on page 1 at 0,0
      coordinates. So I have to do following:

      ...
      myBox.move(myPage);
      myBox.move([myX,myY]);
      ...

      I would like to specify these when adding the rectangle, but I didn't find a
      way yet. Can anyone help me please?


      Thanks
        • 1. Re: Create Page Item on Specific Page/Position
          Peter Kahrel Adobe Community Professional & MVP
          To create a rectangle on a specified page:
          >app.activeDocument.myPage.rectangles.add(myLayer, mySpecs);

          As to the rectangle's position, maybe there's something wrong with your geometric bounds.

          Peter
          • 2. Re: Create Page Item on Specific Page/Position
            Level 1
            Thank you Peter<br /><br />I didn't realize "page" object has the "rectangles" properties.<br /><br />ExtendScript is quite intuitive. But I sometime manage to miss the obvious<br />and spend hours looking for "containingPage" property of a pageItem :(<br /><br /><br />On 10/11/08 13:21, "Peter Kahrel" <member@adobeforums.com> wrote:<br /><br />> To create a rectangle on a specified page:<br />> app.activeDocument.myPage.rectangles.add(myLayer, mySpecs);<br />> <br />> <br />> As to the rectangle's position, maybe there's something wrong with your<br />> geometric bounds.<br />> <br />> Peter