GREP Styles to Local Character Styles
For various reasons it can be beneficial to apply a document's GREP styles as local styles and delete the GREP styles.
This script is part of the GREP collection. See the full collection here.ย
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 Redand 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.
Version history
20 May 2025: An earlier version of this script was posted on Adobe’s user-to-user forum
Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com
Scripts by Topic | Script Index
Basic Script Installation and Use
How to Modify or Configure These Scripts
Resources for Scripting and Publishing Automation
About This Repository
Contact Peter Kahrel
Note to users: You run scripts at your own risk: CreativePro and the author accept no liability for anything that may be caused by any of these scripts. Always take the necessary precautions. We encourage you to save backups and test scripts on copies of your documents.
This article was last modified on August 22, 2026
This article was first published on November 3, 2025
Commenting is easier and faster when you're logged in!
Recommended for you
InDesign GREP Essentials: Wildcards
This article is part of a series of posts on using GREP in InDesign for beginner...
InDesign Basics: Working With Bleeds in InDesign
Bleed is printing that extends beyond the edge of where the paper will be trimme...
Fun with InDesign libraries
Save time and keep your layouts consistent in your workgroups with these great L...
