Skip to main content
Inspiring
July 3, 2023
Question

Inserting a tab before formatted text

  • July 3, 2023
  • 2 replies
  • 707 views

Hi all,

I need a script which insert a tab before UPPERCASE text in "[Paper]" color. Would it be possible?

Thanks in advance,
Rogerio

This topic has been closed for replies.

2 replies

jmlevy
Community Expert
Community Expert
July 3, 2023

I don't know if a script is doable, but why don't you simply run a Find-Change?

Edit: too slow…

Peter Kahrel
Community Expert
Community Expert
July 3, 2023

You don't need a script. In the Grep tab of the Find/Change window:

 

Find what: (?=\u\u+)

Find format: [Paper] colour

Change to: \t

 

 

Inspiring
July 4, 2023

Hi Peter, thanks for that! It worked just as expected. 🙂

I just noticed that some uppercase text contain a anchored object right before it in the documents I'm currently working on. Therefore, the provided GREP is not finding them 😞
Do you know any GREP which add a tab in the midle of an object and uppercase text?

Thanks again for your help!

Regards,
Rog

Peter Kahrel
Community Expert
Community Expert
July 4, 2023

Try this:

 

(?=~a?\u\u+)