GREP Query Runner

This is a much simpler version of the Query manager. It displays a list of all your queries and executes the selected ones.

This script is part of the GREP collection. See the full collection here

For a more capable and more complex utility, consider the GREP Query Manager.

Some replacement tasks cannot be handled by a single Find/Change operation. It’s not really possible, for example, to abbreviate page ranges with a single GREP query. Instead, you need two queries for that.

Unfortunately, InDesign doesn’t let you chain queries into a single action. However, the script on this page does let you do that.

When you run the script, all GREP queries from InDesign’s and the user’s folders are displayed in a list.

Run GREP queries

Select the queries you want to run and click Run or press Enter/Return to execute the selected queries one after another.

Note: The selected queries are executed in the order you see in the list. If you want to change the order of execution you’ll have to change the names of the queries. A simple way to order queries is to prefix them with numbers.

Presets

You can create presets in which you collect any number of queries so that on a next run of the script all you need to do is to select that preset. To create a preset, select any number of queries in the list and click Preset. The script creates a small text file that contains the names of the selected queries and inserts the preset’s name into the list:

Run GREP queries with a preset

A preset is named after the first-selected query and uses the file type .grep-preset.

To change a preset, simply re-create it.

To delete a preset, right-click its name in the Scripts panel and select Delete Script File:

Run GREP queries

For a more elaborate script to run and manage queries, see the GREP query manager script.

Version history

17 Mar. 2024: Bug fix and improvement of the Search dropdown.

16 Mar. 2024: Added the possibility to select the search scope.

25 Apr. 2021: Added support for query presets.

8 May 2016: Added code to get around the problem that listboxes don’t display in CS6 on Windows 10.

16 Sept. 2015: Posted.


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.

Bookmark
Please login to bookmark Close

This article was last modified on August 22, 2026

Comments (0)

Leave a Reply

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

Loading comments...