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

Replace contractions using FindChangeByList

New Here ,
Jul 04, 2024 Jul 04, 2024

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

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 05, 2024 Jul 05, 2024
text    {find what:"I am"}    {change to:"I'm"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}
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
Engaged ,
Jul 05, 2024 Jul 05, 2024

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.

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

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

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

@Raag25804015f4fk

 

I think you need to ESCape the apostrophe:

 

"I\'m"

 

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

 

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