Apply GREP styles as local (normal) character styles

GREP styles can be inefficient, especially when there are many instances in long stories. For this reason (and several others) it's useful to apply a document's GREP styles as local styles – that is, normally applied character styles – and remove the GREP styles.

There is one catch, however. GREP styles are additive, that is to say that you can apply more than one character style to some text and the attributes defined in all character styles are applied (as long as they don't conflict). Local character styles, on the other hand, are exclusive: you can apply only one character style to any given text.

The script works around this limitation of local character styles by creating compound styles. For example, if you have two character styles, Bold and Red and a GREP style applies both these styles to some text, then the script creates a new character style Bold__Red. This style is created by duplicating Bold while basing it on Red. This works for any number of applied character styles applied to the same text.

The script respects existing local styles. If there is some text that has a local character style applied to it and a GREP style, then the script creates a compound style as described above.

The script has no interface, just run it from InDesign's Scripts panel.


Useful script?

Consider making a donation. To make a donation, please press the button below. This is Paypal's payment system; you don't need a Paypal account to use it: you can use several types/brands of credit and debit card.

Peter Kahrel's paypal account

Version history

20 May 2025: An earlier version of this script was posted on Adobe's user-to-user forum


Show script (right click, Save Link/Target As to download)

Back to script index

Installing and running scripts

Questions, comments? Get in touch