Grep to Anchored Object is a useful InDesign script that makes it easy to extract any text in your document out of the main flow of the text and into an anchored object. The anchored object will be anchored to the original location of the text.
An anchored object is any page item (such as a graphic, or, in our case, a text frame) that is linked (or “anchored”) to text. If the text moves, the anchored object travels with it.
Anchored objects have many settings, mainly relating to where on the page the anchored object should appear. They can flow directly with the text, or always appear on a fixed point on the page relative to the text, and much more.
It is beyond the scope of this guide to explain in detail all the options available for anchored objects – more information about them is available here: https://helpx.adobe.com/indesign/using/anchored-objects.html.
Two preparatory steps are required before running Grep to Anchored Object:
These steps will be described below.
If you have not already done so, create an object style that the script will use for the anchored objects it created.
Using the object style’s “Anchored Object Options” set the position and style of the anchored object you wish to create.
You are now ready to run the script.
Here’s a screenshot of the GREP to Anchored Object window:
All settings you make are stored with the document for convenience so they needn’t be reentered every time the script is run. Also, even if you need to edit the document several months later and re-run the script, the old settings should still be there. (This does not affect document portability – so someone who does not have GREP to Anchored Object will still be able to open and edit the document without seeing a “missing plug-in” alert!)
Please feel free to write your questions or comments about Grep to Anchored Object below.
I tried to find grep in the text box and make it a “Grep to Anchored Object” I bought here.
But it did not work.
I am wondering how to create an anchored object exactly where the text box is located.
If you can not achieve “Grep to Anchored Object”, I would like to know if you can provide a script to solve it.
I tried the script and it works fine. But is there also a possibility to copy the text only and don’t delete it?
Hi, this looks like it could be a great help in preparing a document for epub export. Anchoring sidebars and other asides can be a pain in the neck, depending on how the InDesign user set up the document.
Often, a sidebar will have a headline/title and then some paragraphs, so there could be at least 2 paragraph styles, sometimes more (if there’s also a bulleted list, for example). Can this script grab more than one paragraph style, extract them all, and place in an anchored text box? would be fabulous…..
Sure it can, but with a little help, since it’s not possible to search for 2 paragraph styles at once with a single GREP search.
What you could do, though, is, for example, apply a special color to the text of all the paragraphs you want the script to pick up.
Then, set up the GREP search to search for that color, rather than for specific paragraph styles.
Does that make sense?
Thanks for your script, very useful!
Do you develop reverse writing?
1: paragraph with “Para Style 1” to Anchored (your script)
2: Anchored to initial position “Para style 1” (futur script ?)
Thank you for your reply,
Anchored Object feature of the ones
batch cancel , how can it be done
I like the idea of the script, it would help in law books where they want para numbers moving from the text to the outside edges of the page. However, once the book is printed they want a Word file back for editing for the next edition the following year. Would it be possible with this script to reverse this process so that the anchored text gets placed back in the text so that when you export it to Word from InDesign the customer receives the Word file back just like the one they sent but now updated?
mayerMarch 21, 2018 11:14 pm
i have anchored-text box on top of each word and i would like to center it on every word
is it possible to have a script to center each anchored-text box on top of a word