A Script to Convert GREP Styles to Character Styles in InDesign

Use this free script to replace GREP Styles with locally applied Character Styles and make long documents easier to work with.

GREP styles can be an amazingly powerful tool for automatically formatting text. But they do have their downsides. They can be tricky and confusing to work with, especially if you’re editing text in a document you didn’t create (and/or not a GREP whiz).

And they can be resource intensive since InDesign is constantly looking for the GREP patterns to match and apply formatting wherever the style is used in the document.

So, to get the best of all worlds, it would be great if you could apply the desired character-level formatting automatically at first via GREP styles and then convert it to locally applied character styles.

And that’s exactly what you can do with the help of a new script by Peter Kahrel.

After running the script, your paragraph styles will no longer contain GREP styles. And the character styles that those GREP styles had applied will be applied locally. New character styles will be created and applied in situations where more than one GREP style was affecting a piece of text.

To get more info on how the script works—particularly how it handles the additive nature of GREP styles—and download it, click here.

Thanks, Peter!

More Resources To Master InDesign

The InDesign Conference is coming to a screen near you—hosted entirely online, December 9–12, 2025.

Join the world’s most knowledgeable InDesign experts as they share their wisdom, tips, and techniques for building documents of every size and format.

LEARN MORE

Members get a special discount on registration! Sign up today.
Bookmark
Please login to bookmark Close

This article was last modified on May 29, 2025

Comments (5)

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Diane Serpa

    Thank you for publishing this.

  2. Alastair Leith

    I’ve never noticed GREP styles being computationally expensive when navigating the document. even reports that have 100s of pages. I imagine that the GREP style changes get cached along with other page object data and renders rather than re-rendering the changes every single time your page view changes in any way.

    1. Steve Davis

      I’m not so sure, I had a grep style to derunt certain lines and it ground InDesign to a halt.

  3. Haruki Murakami

    if you have trouble with forming regular expressions (GREP/regex) then AI to the rescue. even the best of us can waste time bagging our head against a positive lookahead pattern that just wont do what it suppose to! ChatGTP will write very complex expressions in less time than you can go through the menus to find the characters for negative look behind. I dont need to use it in InDesign but i have been using AI to write regexp in short scripts for scraping text from websites etc.

    The one thing InDesign lacks is the ability to use Regular Expressions (GREP) to actually change the text not just it’s appearance. That would be great in my opinioin. Sure you can write a JSX script to do it and premently change the text but having styles to do it that are easy to import into your document would be even better. I’m often wanting to do something like that with Cross Reference or GREP styles but am blocked because it can only change the appearence of the text. Imagine if the Cross Ref style could take the para text and use the first 20 characters or first 4 words and then put an ellipse (…) after the truncated para text. just of the top of my head, many other things I’ve wished I could do with GREP styles that I can’t do.

    1. Diane Serpa

      I worry that at lot of resources are wasted by many people creating the same script from AI/ChatGPT. It would be better if early scripters published or sold these scripts. That is the problem with AI, a lot of people doing the same things.