Find/Change words (with GREP) and apply a style...
I need a Script for Find/Change words with GREP, and apply a paragraph style...
Thanks...
I need a Script for Find/Change words with GREP, and apply a paragraph style...
Thanks...
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
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.