This script is part of the Book Panel collection. See the full collection here.
You’re working on a text that’s contained in several chapters, which in turn are included in a book file. Now if you want to look for something you’ll have to open all the book files, select ‘All documents’ in the Search dropdown, then do the search. The same goes for making replacements: you must open all documents then run a query.
This is perfectly doable but if your book file contains many files, then opening and closing those files becomes a distraction. The script described on this page makes things easier and much quicker.
Use
Run the script from InDesign’s scripts panel. It opens a small panel:

The idea is that you enter your search string or pattern in InDesign’s Find/Change window, along with any formats and/or replacement text and/or pattern. Now, unfortunately, a script can’t see whether the Text or the GREP tab is active, and it’s impossible to check whether anything was set in the Find Format and/or Change Format panes, so a script can’t derive from the Find/Change window what you want to do. That’s why the script panel is needed.
So enter values in the Find/Change window, select Grep or Text and Find only or Find and change, then click Go to apply the query.
The script is fast because it opens documents without showing them, which saves a lot of time. When a document contains what you were looking for it’s made visible, otherwise it’s closed. So when the script finishes only those files are open that contain what you were looking for. Now you can use Find Next in the Find/Change window – targeting All Documents – to review the found (or replaced) items in all the documents.
Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com
Scripts by Topic | Script Index | Resources for Scripting and Publishing Automation | About This Repository
Contact Peter Kahrel
This article was last modified on June 26, 2026
This article was first published on February 12, 2025
Commenting is easier and faster when you're logged in!
Recommended for you
InDesigning Your Desktop
Just for fun, try using InDesign to improve something that's been right in front...
Member-Only Video: Actually, There’s a Script for That
Must-have free and low-cost scripts for InDesign, Illustrator, and Photoshop, as...
CreativePro Video: How to Use Camera Raw in Photoshop
In the following CreativePro video, Michael Ninness shows us how to use Camera R...
