This topic came up recently in regard to my preferred workflow for importing text from MS Word. Since it’s useful in other applications and important in its own right I’ve decided it needs its own article.
InDesign’s Find/Change function is quite powerful. Not only can it find and change strings of text, but also text and object formatting. It can also employ the powerful GREP language to create complex search queries. But the purpose of today’s post is to focus on one of my favorite features: the ability to save your search query for later use.
Loading Queries & InDesign’s Useful Built-In Queries
To load a previously saved query, open Find/Change (in the Edit menu, or use the keyboard shortcut) and select it from the “Query:” dropdown selector at the top of the dialog. InDesign features some useful preinstalled queries which the developers have created as examples. Notice that queries appear in a list divided into categories; these categories correspond to the “Text | GREP | Glyph | Object” buttons in the Find/Change dialog. Some of these example queries are so useful that I use them routinely to clean imported text:
- Multiple Return to Single Return
- Multiple Space to Single Space
- Remove Trailing White Space
When you load a query, the search settings are loaded into the Find/Change dialog. Note that the search isn’t run; nothing is replaced in the document when you load the query. It just loads the fields. Then you can click one of the operation buttons on the right of the Find/Change dialog to run your search or replace content.
Saving & Designing Your Own Queries
Tired of entering the same things into the find and change fields of the FInd/Change dialog over and over again? Then STOP! And save your query so that you never have to type it in again (well, at least not until you upgrade or reset your prefs). To save a query, simply fill in the fields with the search information and then click the disk icon to the right of the “Query:” dropdown. Type in a name for your query, and that’s it! Your query now appears in the saved list, and can be easily selected any time you use Find/Change.
For example, I make a list of queries that I work through every time I place text from Word. Each of these queries finds a local override format (bold, italic, superscript, etc) and replaces it with a character style that I have already created in the document. I use the same character style names in all my documents so that my queries work across all my documents.
To save a query to change local override italic formatting to my “italic” character style:
- I click the Text button (this way the saved query appears at the very top of the list, rather than down in the GREP section of the list of queries).
- I leave the “Find What” and “Change To” fields completely blank.
- If necessary, click the “More Options” button to show the format options.
- Click the “Find Format” box, click “Basic Character Formats,” and set Font Style to “Italic.” Click OK.
- Click the “Change Format” box and choose my “italic” character style, then click OK.
- Click the disk icon to save the query with an appropriate name.
I’ve also used a number of saved queries in the past for special occasions. I create these as needed for projects. If a query doesn’t appear in my current list, it’s because I haven’t needed it since t the last time I had to reset my preferences! Remember that your list of queries is lost when you (1) reset your preferences or (2) reinstall or upgrade to a new version of InDesign. Some of the things I’ve done with saved queries include:
- get rid of typed tabs at the beginnings of paragraphs
- change forced line breaks to spaces
- change forced line breaks to hard returns
- change multiple tabs to single tabs
If I ever get around to learning GREP, there will be even MORE that I will be able to do with find/change. Stay tuned; you can be sure I’ll write about it when I learn about it!
Doing Multiple Find/Change Queries at Once via Scripts and Plugins
And this can be automated even more by a script that can run multiple queries in sequence…unfortunately I can’t find the specific script I’m thinking of at the moment, sorry. There are a number of them, and I seem to remember one in particular that had a very tidy interface where you simply put in a list of saved queries for it to run through, but now I can’t find it. There’s also a commercial plugin available for about $40 here that can do multiple searches: http://automatication.com/index.php?id=12
However, it takes me less than one minute to work through my list of about 10-12 queries that strip out multiple hard returns, extra spaces, leading tabs, and local override formatting. And I like doing them 1 at a time to make sure they’ve worked! Then, once I’ve tagged all the formatting I want to keep with styles using find/change, I remove all overrides and go back and apply my paragraph styles.
In summary, I use s a combination of InDesign’s built in queries and my own saved queries to quickly clean imported text. I can import hundreds of pages of MS Word documents and clean them of all unwanted formatting while preserving all bolding, italics, superscripting, and other character-based formatting, in about a minute. All that remains is to apply a few headings, block quotes, bullets, and other paragraph-based formatting, which is easy to find by comparing the Indesign file with the original file side by side.