Skip to main content
Participant
April 20, 2025
Question

Anchored side notes for bracketed numbers

  • April 20, 2025
  • 3 replies
  • 237 views

What is the script to programmatically extract all numbers enclosed in square brackets (e.g. [12]) from a text frame in InDesign, create anchored text frames on the left side of the main text flow for each, and apply a specific paragraph style (e.g. 'Number Style') to the extracted numbers within those anchored frames?

3 replies

m1b
Community Expert
Community Expert
April 27, 2025

Hi @Dafna367384030n39 did you get anywhere with this? As Dave and Robert mentioned, a more-usual approach to this would be to use a "hanging indent" where the text is indented, say 10mm and the first line only is "indented" by –10mm so it lines up with the column edge again.

 

Here's a quick mockup in Indesign for you to look at. Open the attached demo.indd. But if that still isn't what you need, let us know.

- Mark

 

Here's annoted screenshot, too:

Dave Creamer of IDEAS
Community Expert
Community Expert
April 20, 2025

Of course, the hanging numbers are simply a left indent with a negative first line indent.

For the extraction, were you thinking of this script:

https://www.id-extras.com/products/grep-anchored-object/

 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Robert at ID-Tasker
Legend
April 20, 2025

You could do it with left indent - with or without widening your TextFrame to the left.