Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign!

A Script to Edit Styles with Find/Change

Bookraft Solutions has created a really useful script that will be of interest to anyone who works with documents containing styles. Search in Styles ($49 USD) will let you perform a Find/Change operations to edit your document’s paragraph and character styles. Why is this useful? Here are a couple examples:

When you first run the script, all of your paragraph styles are displayed in a long list. Clicking on the Find/Change button displays InDesign’s Find/Change dialog box, shown here on the left.

Now, imagine that I want to find all of the Paragraph Styles that specify 9.5 pt type. First, I specify that in the Find Format field in the Find/Change dialog box on the left. Then I specify 10 pt type in the Change Format field, so the dialog boxes look like this:

Next, I click on the Update List button to load the settings from the Find/Change dialog into the Search in Styles dialog and display only the Paragraph Styles that specify 9.5 pt type:

Then, I click the Change All button to change the styles in the list to 10 pt. In the screen shot below, the button has already been clicked, so the “QA question text” and “QA answer text” styles have disappeared from the list, because they no longer specify 9.5 pt…they’ve been changed to 10 pt:

Here’s another thing you can do with the script. Imagine you want to find all the Paragraph Styles with “Title” or “title” in the name, and change the font in those styles to Adelle Sans Bold. In the screenshot below, I’ve entered Title|title in the Find what field. The “|” character means “or” in GREP code. The script supports simple GREP expressions in the find and change fields.

In the Change Format field, I’ve specified Adelle Sans Bold. After clicking on the Update List button, I see all the Paragraph Styles with “title” in the name displayed in the list. Clicking on the Change All button would change all of these styles to specify Adelle Sans Bold.

This script could save hours of work and frustration. It would be particularly useful for cleaning up documents that have been authored and edited over a long period of time by several people. These documents tend to be full of old, redundant, or mislabeled styles. Cleaning these up would be much easier with the help of this script.

Keith Gilbert

Keith Gilbert

Keith Gilbert is a digital publishing consultant and educator, Adobe Certified Instructor, Adobe Community Professional, conference speaker, lynda.com author, and contributing writer for various publications. His work has taken him throughout North America, Africa, Europe, and Asia. During his 30 years as a consultant, his clients have included Adobe, Apple, Target, the United Nations, Best Buy, General Mills, Lands' End, and Medtronic. Follow him on Twitter @gilbertconsult and at blog.gilbertconsulting.com.
Keith Gilbert

Latest posts by Keith Gilbert (see all)

  • - November 30, -0001
Tags
Related Articles
Comments

5 Comments on “A Script to Edit Styles with Find/Change

  1. I use the Multi Find/Change plugin that also allows for changes in styles:
    From the Manual:
    • Character Styles – Search in Character Styles (valid only for Text and GREP queries).
    • Paragraph Styles – Search in Paragraph Styles (valid only for Text and GREP queries).

    How would you compare the two Keith?

    • Bart, I LOVE Multi Find/Change! I had forgotten that MFC allows you to search in paragraph and character styles. Thanks for pointing that out.

      The 2 products complement each other. MFC’s strength is in being able to string together multiple queries, and perform them all with one command. But it requires more setup than Search in Styles to do just a simple single find/change in styles.

      Search in Styles gives you really nice visual feedback about which styles match your find criteria, so that you know what the extent of your change is going to be. This is really important when trying to clean up “mystery styles” in a complex document that you didn’t create.

      Search in Styles, on the other hand, doesn’t allow you to string together multiple queries into a single operation like MFC does.

  2. The script is quite useful for those wrestling with an existing style set, but keep in mind that you can used the ‘based on’ of paragraph styles to establish a master style that defines only the font and font size of, for instance, all body text. Change that master, and all the ‘slave’ styles change, whatever their other differences.

    The webpage linked also has another useful style, one that applies a master page based on the paragraph and object styles on that page.

    http://www.id-extras.com/products/mastermatic

    What I’d like most is an add-on that does a find with multiple replaces that are chosen when the find result is on screen. Often, I do searches in which I need to replace one item with two or more different items, depending on the context. That means either stopping to hand edit one of the changes or making two search passes.

    A better UI for search/replacment would also be handy in the same add-on. Most S/Rs mean jumping between Find Next (i.e. do no replacement) and Change/Find (replace and move on). But in Adobe’s UI, that means hopping over the dread Change All button ot do that. When you’re making hundreds of changes by hand, it is easy to click on the wrong button. Change All needs to be well isolated from the others.

    Search and replace in ID is actually quite marvelous, particularly in comparison to all the other apps I use. It just needs a few tweaks to make it near-perfect. S/R tasks tend to be so tedious, any deficency ends up one users must cope with hundreds of times. It can get mind-numbing. That button-hopping is one illustration that’d be easily fixed.

Leave a Reply

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