Script for Adobe InDesign
Latest update 2/22/2023, version 2.9
The script searches a document or selected story for characters set to bold, italic, and other text decorations, and applies selected character styles, done in one operation rather than repeated visits to the Find/Change dialog. The script was created to prepare content imported from word processing applications where text is manually set to bold, italic, etc. If not assigned a character style, manual styling of text can be lost once applying a paragraph style and/or clearing overrides.
- Find common font styling and apply character style
- Creates character styles if needed
- User-configurable localization
How to use the script
The interface has two sections: Search and Styles. Set options as desired and click OK to begin. There is no user interaction while processing. The script searches for text set to each style to find, and for all instances found, the character style in the corresponding drop-down list is applied. Once complete, the user is notified.
Before launching the script, it is best to add to the document and configure desired character styles, but this is not required. Any character style the script attempts to apply, if absent from the document, is created during processing. Afterwards, any style created by the script may be further configured as desired. For example, set font style to “Semibold” rather than “Bold”, or “Oblique” instead of “Italic”, if needed to match the family of the font ultimately applied to the entire text.
Section 1: Search
Document — searches all stories of the document that is currently open and the top-most window if multiple documents are open.
Story — searches only the selected story. If no story is selected, the choice is disabled. The user may also choose Document to increase the scope of text searched.
Section 2: Style
Each checkbox is a style to find followed by a drop-down list from which to choose the character style to apply. Styles to find that are unchecked are ignored and any text set to the font style remains unaffected. Note the font style oblique is considered italic and assigned the character style.
Each time processing begins, the selected options are preserved, and the next time the script is launched, the options are restored to the last values used. Note however that any character style not one of the defaults (Bold, Italic, etc.) and that doesn’t exist in the current document, may revert to default.
By default the script language is US English, which does not require further download or configuration. To have the script interface display other languages, choose from the available languages below. Download and copy the .i18n file to the script folder alongside the script. When launched, the script detects the language file and displays interface text in that language. If your language is not listed, download the English file and translate it. The file is plain text formatted as JSON, containing interface text in English, and a second value for its translation, which for the English file is the identical text. Copy the file and rename it to replace “en” with the relevant code for your language, then edit the file to change each line’s second value to the translation in your language. For more detailed instructions of how to edit and install i18n files, see How to Localize Scripts.
Change log: style-characters.txt
Related scripts from other sources:
- Protect local styling by Kasyan Servetsky
For help installing scripts, see How to Install and Use Scripts in Adobe Creative Cloud Applications.
Custom solutions based on any script, or completely new ideas, are possible at reasonable cost. Contact William for more information.
IMPORTANT: by downloading any of the scripts on this page you agree that the software is provided without any warranty, express or implied. USE AT YOUR OWN RISK. Always make backups of important data.
IMPORTANT: fees paid for products purchased from this site, or for programming custom solutions, are the purchase of a non-exclusive license to use the software and do not grant the purchaser any degree of ownership of the software. Author of the intellectual property and copyright holder William Campbell retains 100% ownership of all code used in all products and custom solutions.
IMPORTANT: scripts are developed for the latest Adobe Creative Cloud applications. Many scripts work in CC 2018 and later, even some as far back as CS6, but may not perform as expected, or run at all, when used in versions prior to 2018. Photoshop features Select Subject and Preserve Details 2.0 definitely fail prior to CC 2018 (version 19) as the features do not exist in earlier versions. For best results use the latest versions of Adobe Creative Cloud applications.