2 Replies Latest reply on Mar 27, 2012 1:07 AM by Big Jord

    Find/Change 'Change All' gives wrong outcome.

    Big Jord

      I'm having a bit of an issue with the 'Change All' function of Find/Change in InDesign CS4 (On Mac). I have some text, and at the start of each paragraph in the number of that paragraph in the Para style, like this:

       

      2.82 The collective...

       

      What I need it to be is like this:

       

      2.82

       

      The collective...

       

      With the '2.82' in a ParaNumber style and the text in the Para style. Using a GREP string of '^(\d+\.\d+)\s' to find these numbers, replacing it with '$1\r' and changing the style to ParaNumber. This works fine IF I change every occurance one at a time. If I use 'Change All', it will split the number from the text but will change both the number AND the text to the ParaNumber style. Why do the results change and give the wrong outcome when using 'Change All'?

       

      This problems becomes a pain when I have hundreds of paragraphs per chapter, and many chapters.

        • 1. Re: Find/Change 'Change All' gives wrong outcome.
          [Jongware] Most Valuable Participant

          It seems a subtle change in behavior: with Find/Change, the text change is made and then the formatting is applied. Apparently, with Change All this happens in reverse!

          I can't vouch for CS5 or newer as I am also still on CS4 -- in any case it's too late (by 1.5 versions) to log this as a bug for CS4.

           

          Only solution I can see is to run your GREP first without applying the paragraph style, and then another one to change

           

          ^\d+\.\d+$

           

          to your ParaNumber style.

           

          If you have tables or something similar where this style should *not* be applied (essentially only when it had text before, as in your own GREP), you need something more complicated. Change the initial GREP to add something unique in the replacement string, then in the second run remove that again whilst applying your style. As in:

           

          Round 1: search "^(\d+\.\d+)\s", replace with "$1{HEADER}\r"

          Round 2: search "^(\d+\.\d+)\{HEADER\}", replace with "$1" plus paragraph style

           

          (Incidentally, the {..} need no escaping in the 1st Round Replace field but do so in the 2nd Round Find field.)

          • 2. Re: Find/Change 'Change All' gives wrong outcome.
            Big Jord Level 1

            I have no idea why I never thought of running it without the style change then again to add the change, it seems so obvious! Saves me a lot of clicking though, thanks.