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

Replace contractions using FindChangeByList

New Here ,
Jul 04, 2024 Jul 04, 2024

Copy link to clipboard

Copied

I'm trying to replace contractions in a book I'm editing using the FindChangeByList script. Replacing words like 'I am' to 'I'm', 'It is' to 'It's' etc.

 

I tried editing the txt file the script uses and adding the following command - 

 

text {find what:"I am"} {change to:"I'm"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find all I am and replace with I'm.

 

But it isn't working. What am I doing wrong here? (Attaching a screenshot)

TOPICS
How to , Scripting

Views

201

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 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

quote

text {find what:"I am"} {change to:"I'm"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}


By @Raag25804015f4fk

Do you have each section separated by a tab character?

It's tab delimited I think, make sure there's no spaces.

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 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

text    {find what:"I am"}    {change to:"I'm"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}

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
Engaged ,
Jul 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

text {find what:"I am"} {change to:"I'm"} works for me. Make sure that there is a tabulator between items of a line in the FindChangeList.txt. I always copy a line FindChangeList.txt and modify it.

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 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

Thanks for confirming my findings too - and ensuring it's tabs/tabulated instead of spaces.

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 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

@Raag25804015f4fk

 

I think you need to ESCape the apostrophe:

 

"I\'m"

 

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 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

LATEST

Yet another possibility is that the space in I am isn't a plain space but e.g. a non-breaking one. To get around that, use a GREP replacement rather than a Text replacement, using a catch-all for the space:

 

grep {find what:"I\\ham"}

 

where \h stands for 'horizontal space', that is, any space.

 

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