Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Inserting a tab before formatted text

Contributor ,
Jul 03, 2023 Jul 03, 2023

Hi all,

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

Thanks in advance,
Rogerio

TOPICS
How to , Scripting
761
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2023 Jul 03, 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

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 04, 2023 Jul 04, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2023 Jul 04, 2023

Try this:

 

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 05, 2023 Jul 05, 2023

Hey Peter, I tried it, but no luck 😞

Maybe I'm doing something wrong? I attached an indd here, so you can give it a try as well.

Thanks,
Rog

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 05, 2023 Jul 05, 2023

Edit your "Hyperlink" char style and change its color to [paper]

 

Then Find: ^(?=~a?\u)

 

(^/)  The Jedi

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 06, 2023 Jul 06, 2023
LATEST

Hi @FRIdNGE, thanks for checking! 🙂

The tab should go right after the anchored object and not before. Would it be possible?

Thanks,
Rog

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2023 Jul 03, 2023

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

Edit: too slow…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines