September 28 2009 • 8:05 PM

Find-Change Scripting Goodness

FindChangeByList is a nifty script that ships with InDesign, for cleaning and formatting text. Its virtues have been extolled numerous times here at InDesignSecrets and on podcast #90. The script works by reading a text file containing a series of Find/Change routines, and executing them, one after another, in a flash. But one pitfall that I and others have fallen into while trying to use FindChangeByList, is that it’s very easy to make mistakes in formatting the text file that the script references. An extra tab, or a missing backslash, and you’re toast. Fortunately, Ukrainian prepress specialist and developer Kasyan Servetsky has posted two scripts on his website that take some of the pain out of FindChangeByList, and extend the concept with an even easier method.

The first is called Record Find Change CS3. Don’t mind the “CS3″, it works just fine in CS4 too. It was written by Martin Fisher, and works by translating your current Find/Change settings to a text file, perfectly formatted for use with FindChangeByList. All you have to do is set up the Find/Change dialog box with the options you want, and run the script. Then you copy and paste the results into the text file you wish to use with FindChangeByList.

The script turns this:

Into this:

The second script is one that Kasyan wrote himself. It’s called Find Change By Queries. It also works in CS3 and CS4, to capture the contents of the Find/Change dialog box (currently from the Text tab only) and write them to text files. However, this script doesn’t rely on FindChangeByList. It does all the work by itself, and interestingly, it saves each Find/Change routine, or “query” as a separate numbered text file that you get to name.

The script turns this:

Into this:

These numbered text files are saved in a Queries folder. You can easily change the order in which Find/Changes are executed by renumbering the text files. You can also control which queries are run by adding or removing text files from the Queries folder.

In addition to these great Find/Change scripts, Kasyan has posted several other interesting scripts for InDesign and Photoshop.

Check them out. I bet you’ll find something that can change your work for the better.

8 Responses discussing this post. Add yours below.

  1. September 28th, 2009 • 9:28 pm • Link

    Cool! It sure is handy that whenever I need something, someone I’ve never met anticipates my need and takes care of it. Thanks for the tip and thanks to the scripters for the scripts. I’ll be using them as soon as I get them installed.
    Olaf

  2. Colin Flashman
    September 29th, 2009 • 4:49 am • Link

    This is gold. My work often has projects where the text supplied is full of old-school formatting code which needs to be replaced with proper formatting and so far i’ve been using the findchangebylist.jsx to do this, but have had the complications of getting my coding wrong from indesign to the text file, so the first script here is just awesome. well done!

  3. Toyava
    September 29th, 2009 • 8:14 am • Link

    One of the numerous FindChangeByList Mod also can write in to a text file all query from your working file formatted for use with FindChangeByList

  4. September 13th, 2010 • 2:00 pm • Link

    the FindChangeByList is a great tool, however it seems to crash if you overload the text file with search patterns. i made up like 2 pages of rules today and ID crashed when i ran the plugin.. might be due to my hardware, but who knows!

  5. September 14th, 2010 • 5:51 am • Link

    While findchangebylist is great, it’s much easier to use Automatication’s MultiFindChange add-on.

  6. September 14th, 2010 • 6:31 am • Link

    Agreed! Lucian, if you like FindChangeByList, you’ll love MultiFindChange.

  7. Heulwen Jones
    December 5th, 2011 • 12:03 am • Link

    I have been using the ‘FindChangeList.jsx’ script and it works well for what I need except for one thing: ideally I want to search for a piece of text with a certain character style applied. Is it possible to do something like

    {findWhat:”Some text”, appliedCharacterStyle:”character style name”}

    I did try the above but it basically ignored the character style and found all text matching the phrase. Any ideas?

    Many thanks. HJ

  8. Heulwen Jones
    December 5th, 2011 • 4:21 pm • Link

    Problem solved – I was making two mistakes. Firstly the style was a paragraph style not a character style and secondly it was grouped in a folder. So I moved it out of the folder and changed the code to ‘appliedParagraphStyle:’ and everything worked well. : )

    Thanks. HJ

Subscribe to the Discussion

Get the ongoing discussion surrounding "Find-Change Scripting Goodness" delivered to you. Click here to subscribe via RSS.

Leave a Reply

You can use limited HTML tags, such as <em></em> for emphasis/italics and <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

InDesignSecrets reserves the right to edit and/or remove posts and comments.