Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign!

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.

Tags
Related Articles
Comments

12 Comments on “Find-Change Scripting Goodness

  1. 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. 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. 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. 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. 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

  6. 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

  7. Hello,

    I’ve been using RecordFindChange.jsx with FindChange by List etc. . . for a long time. But I’ve noticed that RecordFindChange.jsx records the find query, but not any formatting specified in the search. I.e. if I want to do a grep search for superscripted #s and apply a character style, it ignores the “superscript” setting. If I try using the text tab for superscripted text, again it ignores the character formatting.

    It does recognize Underline: true – my guess is that the settings that have checkboxes work but not the ones with mini-dropdown menus. I tried typing “Position:Superscript” and “Superscript:True” in the search field of the script line, but the first crashed the script and the 2nd was ignored.

    Anyone know how to include superscripting in scripted find/change? I can do this with regular find/change or multi-find/change but I like FindChangebyList because it’s easier to look at your queries if there is a problem and fine tune them instead of having to redo them.

  8. I’m working on a newsletter at work, and for some reason when I started to work on the newest version, the FindChangeByList stopped working. I started to alter the scripts, but obviously have no idea what I’m doing… and now I’ve lost the default script settings. Can someone copy and paste them? I keep looking in forums, but this stuff is just way over my head, unfortunately. :(! So frustrated!!!!

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>