Skip to main content
Marcos_Suárez
Known Participant
February 9, 2010
Answered

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

  • February 9, 2010
  • 2 replies
  • 3786 views

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

Thanks...

This topic has been closed for replies.
Correct answer Kasyan Servetsky

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

2 replies

Participating Frequently
September 14, 2011

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

Jongware
Community Expert
Community Expert
February 9, 2010

FindChangeByList.jsx

FindChangeByList.applescript

They come installed with your InDesign.

Marcos_Suárez
Known Participant
February 9, 2010

Thanks...

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

Inspiring
February 10, 2010