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

Find/Change words (with GREP) and apply a style...

New Here ,
Feb 09, 2010 Feb 09, 2010

I need a Script for Find/Change words with GREP, and apply a paragraph style...

Thanks...

TOPICS
Scripting
3.7K
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

correct answers 1 Correct answer

Valorous Hero , Feb 10, 2010 Feb 10, 2010

Hi Marcos,

If you want the script to create character styles: Bold , Italic, Bold Italic, etc, and replace local formatting with these styles, use scripts in post #3.

But if you want find and change words, or/and replace local formatting with styles defined by you, use FindChangeByList script.

If the latter, I recommend you to download and install Record Find Change script (written by Martin Fisher).

Then choose settings you need in Find-Change dialog – make sure they work as expected – and run Re

...
Translate
Community Expert ,
Feb 09, 2010 Feb 09, 2010

FindChangeByList.jsx

FindChangeByList.applescript

They come installed with your InDesign.

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
New Here ,
Feb 09, 2010 Feb 09, 2010

Thanks...

But I need chage all italic/bold words to character styles..., but with a script

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 ,
Feb 10, 2010 Feb 10, 2010

Use attached script.

Or

Use Jongware script http://www.jongware.com/binaries/preptext.zip

Shonky

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
Valorous Hero ,
Feb 10, 2010 Feb 10, 2010

Hi Marcos,

If you want the script to create character styles: Bold , Italic, Bold Italic, etc, and replace local formatting with these styles, use scripts in post #3.

But if you want find and change words, or/and replace local formatting with styles defined by you, use FindChangeByList script.

If the latter, I recommend you to download and install Record Find Change script (written by Martin Fisher).

Then choose settings you need in Find-Change dialog – make sure they work as expected – and run Record Find Change script. A Notepad/TextEdit file will pop up with a line containing the recorded setting. Copy it, open FindChangeList.txt, delete the contents of this file and paste the line you just copied (or add it to the bottom of the file).

Repeat the process for all find-change operations you need.

Finally run FindChangeByList.jsx to make all changes in one go.

However, while using Record Find Change script, you may encounter a problem: it doesn’t record paragraph and character styles placed inside a group. But you can write references to such styles like so:

appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Style Group 1"). paragraphStyles.item("Paragraph Style 1")

Kasyan

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
New Here ,
Feb 10, 2010 Feb 10, 2010

Thank you very much Kasyan and Shonkyin...

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 Beginner ,
Feb 25, 2010 Feb 25, 2010

This is great info! I had downloaded the script yesterday, but when I got the output "findchangestrings.txt" file I didn't know where to put the info (into the findchangebylist.txt file). Of course, this is the first script I've ever used. When I did finally figure that out, it seemed to me, though that the "recordFindChange" script added a text section and a grep section automatically in the txt output, although you're only doing one or the other. So the first time I ran the FindChangeByList.jsx script, having copied everything from the output txt file into the FindChangeByList.txt file, I got an error. Since I'd had a grep search, not a text one, I just deleted the text line, and the script worked wonderfully.

Now my problem is that the RecordFindChange script always returns only a blank FindChangeStrings.txt file. What might I be doing wrong today?

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 Beginner ,
Sep 14, 2011 Sep 14, 2011
LATEST

I'm want to apply some styles in a group, where do I have to add this: appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("St yle Group 1"). paragraphStyles.item("Paragraph Style 1")? I guess is in the .jsx but where...I have no idea!

Thanx

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