2 Replies Latest reply on Nov 20, 2015 6:34 AM by winterm

    How do you remove all anchored objects at once?

    eltrampo

      Hi,

       

      I have a document where custom 'bullet points' have been inserted, these are anchored objects. I need a method of selecting all of them with the document and deleting them all at once.

       

      If anyone could help it would save me manually clicking on each one and deleting them... there is a lot.

       

      Cheers,

       

      Ads

        • 1. Re: How do you remove all anchored objects at once?
          Peter Spier Most Valuable Participant (Moderator)

          Several years ago Jongware provided this script to me:

           

          //by jongware
          
          n = app.selection[0].textFrames.length;
          while (n >= 0)
          {
               try {
                    app.selection[0].textFrames[n].anchoredObjectSettings.releaseAnchoredObject();
               } catch(_) {}
               n--;
          }
          

          It releases ALL anchored objects in the document, which may be more than you had in mind, but I'm pretty sure it could be modified to restrict the selection to the current frame if necessary, and to delete the released object.

          • 2. Re: How do you remove all anchored objects at once?
            winterm Level 4

            Actually, you don’t need script here.

            in Find/Change (Text tab) enter:

            Find What: ^a

            Change to: leave it empty

            Select Search: Document, Story, Selection... whatever you need.

             

            It will find and delete all anchored objects.

            1 person found this helpful