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

Format text with the script that comes in InDesign with find/change with grep

Community Beginner ,
Sep 11, 2024 Sep 11, 2024

Copy link to clipboard

Copied

Hi to the whole community.

I have a lot of very similar documents with fields that I have tried format with the Indesing "Find/Change List" script, however I do that in some cases work but other cases don't.
I attach the InDesign document and FindChangeList file with some examples.

I attached two files (InDesign with some text and the .txt files with the examples of grep find/appliedParagrpahStyle that work and those that don't work).
In the .txt file you can see //It works very well and //But the others such as chapter, section and others do not work.
Can anyone help me?
I am very grateful for that.

TOPICS
Scripting

Views

176

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 ,
Sep 11, 2024 Sep 11, 2024

Copy link to clipboard

Copied

I'm on my phone so can't check - what is the encoding of your TXT file? 

 

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 Beginner ,
Sep 16, 2024 Sep 16, 2024

Copy link to clipboard

Copied

Hello.
Thank you very much Robert for showing interest in my problem.
The script I'm using is the same as what InDesign brings, I just changed the name of the script and the name of the .txt file

Just like I said, what's really strange is that it works for some situations and doesn't work for others.
I will attach the Script in .txt format because the forum does not allow attaching .jsx files. After downloading, simply change the extension to .jsx. The InDesig file and the FindChangeList.tx file are already attached in the previous post.
Thank you very much.

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 ,
Sep 16, 2024 Sep 16, 2024

Copy link to clipboard

Copied

I haven't looked at it in recent years, but about 8 years ago I studied the GREP approaches in the FindChangeByList and found that many of them were formed badly because the Find included hard returns and caused paragraph style changes if used as shipped. Those built-in FindChange sequences work ok if all the text is raw or unstyled or all styled the same. The changes I made in my version largely revolved around changing the Finds from including hard returns to MATCHING (positive look-aheads and positive look-behinds) to a hard return. Done this way, the Find/Changes can be run early or late in a document's development, since none of the Find/Changes can goof up existing applied paragraph styles. When I get a chance to examine the shipping version, I will double-check if it is the same old searches, or whether the Adobe boffin have improved it in recent years.

 

Update: I just had a look at Find/ChangebyList.txt. Lines 31, 34, and 36 are still as they were originally. They are destructive and should be modified to MATCH; not select. This would produce a safer FindChangebyList.

 

2nd Update: I just read through your uploaded code. You note that Capitulo and Seccau do not work, but Articulo does.

I suspect it is the specially accented (diacritics) letters in those two words that the plain-old-programmers-English-language cannot understand. Maybe try to wildcard those characters and see if it works correctly?

Mike Witherell

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 Beginner ,
Sep 17, 2024 Sep 17, 2024

Copy link to clipboard

Copied

LATEST

Hi, Mike.
I was analyzing it and just like you said in your post, the problem was with the letters with special accents.
I'm still going to do more tests but I think the path is this way.
Thank you very much.

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