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

Inserting a tab before formatted text

Contributor ,
Jul 03, 2023 Jul 03, 2023

Copy link to clipboard

Copied

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

Views

248

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

 

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Try this:

 

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

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

 

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

 

(^/)  The Jedi

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Hi @FRIdNGE, thanks for checking! 🙂

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

Thanks,
Rog

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Edit: too slow…

Votes

Translate

Translate

Report

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