Copy link to clipboard
Copied
Hi
I have few paragraphs where I have put an anchor marker at the beginning of the line.
I now want to give a tab before and after that anchor marker.
Currently I am using a GREP query which work only if I do find and replace one by one. The moment I do change all it deletes the anchored object also.
The query which I use is Find what: ^~a and Replace with: \t$0\t
I have attached screenshots.
What am I doing wrong ?
Thanks.
Hi @shahidr100:
~a should be in parentheses so that InDesign can capture it and add it back with $0.
That said, Change works and Change all appears to remove them, but... check Story Editor. The anchors are still there. They just no longer appear in Layout view. I don't get it.
But here's a different approach: do one manually, copy it to the clipboard and change by pasting.
~Barb
@Barb Binder Found a way to achieve what I mentioned in my question. Actually took help of some expert in Facebook Group. Sharing the solution here so that anyone who face the same issue can use this code.
It's an InDesign bug that GREP does not work well with Anchors sometimes.
Here we have to run GREP two times. First at add a tab before the anchor and then again run GREP to add a tab char after the anchor.
To add a Tab char before use following:
F: ^(?=~a)
C: \t
To add a Tab character after the an
...Copy link to clipboard
Copied
Hi @shahidr100:
~a should be in parentheses so that InDesign can capture it and add it back with $0.
That said, Change works and Change all appears to remove them, but... check Story Editor. The anchors are still there. They just no longer appear in Layout view. I don't get it.
But here's a different approach: do one manually, copy it to the clipboard and change by pasting.
~Barb
Copy link to clipboard
Copied
@Barb Binder Thank you so much for the help. It seems that there is a bug. Anyway, I will follow your method.
Thanks once again.
Regards
Copy link to clipboard
Copied
@Barb Binder One question. Its out of the topic. How did you make this small video of steps? I mean through which software. Thanks
Copy link to clipboard
Copied
Hi @shahidr100:
I use Snagit for my 30-second forum videos and screen shots, and Camtasia for my training webinars. (I'm an instructor.) Both from https://www.techsmith.com. I do think both are built into your OS, I just prefer the ease and editing functionality of these apps.
Mac: https://support.apple.com/en-us/HT208721
Win: https://www.microsoft.com/en-us/windows/learning-center/how-to-record-screen-windows-11
~Barb
Copy link to clipboard
Copied
@Barb Binder Found a way to achieve what I mentioned in my question. Actually took help of some expert in Facebook Group. Sharing the solution here so that anyone who face the same issue can use this code.
It's an InDesign bug that GREP does not work well with Anchors sometimes.
Here we have to run GREP two times. First at add a tab before the anchor and then again run GREP to add a tab char after the anchor.
To add a Tab char before use following:
F: ^(?=~a)
C: \t
To add a Tab character after the anchor use following:
F: ~a\K
C: \t
Copy link to clipboard
Copied