1 Reply Latest reply on Jan 9, 2014 8:37 AM by Jump_Over

    Anchored Object release



      I'm using InDesign CC and when releasing an anchored object the pointer to the previously anchored object is lost,

      actually the pointer is passed to the next object in the page


      Locate an anchored object on the page:


      groupRectangle = myPage.pageItems.itemByName("groupRectangle")

      groupRectangle.anchoredObjectSettings.releaseAnchoredObject ()


      //oops: the previously groupRectangle is no longer the object groupRectangle  - it is the following object in the page - it even passes its id.


      is it a bug?



        • 1. Re: Anchored Object release
          Jump_Over Level 5



          "oops" can be said earlier


          If groupRectangle is anchored - you can not match it this way:

          groupRectangle = myPage.pageItems.itemByName("groupRectangle")

          This is an object but it is not valid (groupRectangle.isValid == false) since myPage isn't it's parent.


          Try to match it this way:

          groupRectangle = myPage.textFrames.everyItem().pageItems.itemByName("groupRectangle").getElements()[0];


          It should keep the pointer after release