Perform multiple find/change (or GREP) queries at once
August 29, 2013 Leave a comment
The find/change dialog box is a useful tool in InDesign until many searches need to be done at once. For example, an imported word processor file contains double spaces, double returns, spaces at the start of lines etc that need to be tidied. Using solely find/change, each item needs to be found and changed before the next item can be found and changed, meaning typing in the find field, then the change field, then change (or change all). This applies to GREP searches as well.
Ultimately, is there a way to perform many find/changes to text at once? Luckily, the answer is yes, there are several. Will they also change more than the text (such as formatting), not all methods outlined will do this. Some solutions listed below are still in Beta testing, while others may or may not work with Creative Cloud. Links to the providers of each solution has been provided for those seeking more information.
First method – default script (with outside assistance)
There is a script that ships with InDesign called findchangebylist.jsx. This script runs many find/change commands that are stored as text in another file called FindChangeList.txt.
By changing specific lines in the script and making and renaming copies of the FindChangeList.txt file, many different “chained searches” can be made and stored for later use.
Because the code used in the FindChangeList.txt file is rather cody, scripter Kasyan Servetsky has created a script that will take whatever is in the find/change dialog box and turn it into code that can be cut and pasted into the FindChangeList.txt file.
For regular visitors to this site, this article may seem like déjà vu, and that is because this solution has been discussed on Colecandoo before:
Second method – scripts:
GREP Queries Manager by Peter Kahrel
Unlike the first method, this has a user interface and deals with GREP searches rather than both GREP and find/change searches.
For full details on how it works, go to: http://www.kahrel.plus.com/indesign/grep_query_manager.html
Doquery by Mikhail Ivanyushin
Again, this has a user interface and can use find/changes or GREP searches that have been previously used and saved with the find/change dialog box.
For full details on how it works, go to: http://adobeindesign.ru/2012/10/27/doquerylist-programma-obrabotki-teksta-zaprosami/
Batch find and replace by Fabiantheblind
This solution does not have a user interface but rather works in a similar fashion to InDesign’s default script but uses Fabian’s own expression language.
For full details on how it works, go to: https://github.com/fabiantheblind/batch-find-and-replace
This solution has a user interface and can perform many find/changes at once, whether regular find/change or GREP.
For full details on how it works, go to: http://www.kerntiff.co.uk/free-stuff/xchange-strings-xstrings
Third method – plug-ins
This plug-in has a user interface and what the find/change dialog box in InDesign should really have shipped by default. Nevertheless it is cheaper than a slab of beer and will last much much longer.
For full details on how it works, go to: http://automatication.com/
Action Recorder (Rorohiko)
While still in the Beta stage, Rorohiko is attempting to make what is arguably missing from the InDesign menu: the Actions palette. Other than running find/change commands, this extension allows much more chaining and automation of other non-text based tasks, but at the time of writing is still too early to tell.
For full details on how to become involved, go to: http://www.rorohiko.com/wordpress/2013/08/06/action-recorder-beta-released/