6 Replies Latest reply on Jul 27, 2010 6:24 AM by L_MATTSON

    FindChangeByList and associated text files

    L_MATTSON

      I am in the process of converting from CS2 to CS5 and need to update all of my text files that run with the FindChangeByList script. I did not write these files but was involved in the decision to use them for our processes so my knowledge of them is minimal. Unfortunately, no one left at my company has any knowledge of them so it is up to me to dig in and update. I have been able to figure the majority of the conversion out, but am stuck on the last "column."

       

      An example of our existing script looks like this:

      {findText:" ^t"}     {changeText:"^t"}     all
      {findText:"^t^t"}     {changeText:"^t"}    all
      {findText:" ^p"}     {changeText:"^p"}    all
      {findText:"^t^p"}     {changeText:"^p"}   all
      {findText:"^p^t"}     {changeText:"^p"}   all
      {findText:" -"}     {changeText:" ^= "}    all
      {findText:" - "}     {changeText:" ^= "}   all
      {findText:" AM^p"}     {changeText:" am^p"}   once
      {findText:" PM^p"}     {changeText:" pm^p"}   once
      {findText:" AM^t"}     {changeText:" am^t"}     once
      {findText:" PM^t"}     {changeText:" pm^t"}     once

       

      I am converting it to this:

      text     {findWhat:" ^t"}     {changeTo:"^t"}     {}

      text     {findWhat:"^t^t"}     {changeTo:"^t"}    {}

      text     {findWhat:" ^p"}     {changeTo:"^p"}    {}

      text     {findWhat:"^t^p"}     {changeTo:"^p"}   {}

      text     {findWhat:"^p^t"}     {changeTo:"^p"}   {}

      text     {findWhat:" -"}     {changeTo:" ^= "}    {}

      text     {findWhat:" - "}     {changeTo:" ^= "}   {}

      text     {findWhat:" AM^p"}     {changeTo:" am^p"}   {}

      text     {findWhat:" PM^p"}     {changeTo:" pm^p"}   {}

      text     {findWhat:" AM^t"}     {changeTo:" am^t"}     {}

      text     {findWhat:" PM^t"}     {changeTo:" pm^t"}     {}

       

       

      I know I am supposed to enter text along the lines of caseSensitive:true, wholeWOrd:false, etc. Is there a quick way to determine if it says Once, it should be changed to say {   } and if is says All, to use {  }, or do I go line by line to try to determine what the correct tag should be?

       

        • 1. Re: FindChangeByList and associated text files
          Kasyan Servetsky Level 5

          Here is a script that I found on InDesignSecrets.com. It records the current find/change text and grep preferences to a text file so that you can copy/paste them into your find-change list file. Just choose the settings you want in InDesign and run the script.

           

          Kasyan

          • 2. Re: FindChangeByList and associated text files
            L_MATTSON Level 1

            Hi Kasyan- I have been reading a lot on this subject today and your name comes up often. I was hoping you would find my question and answer it. I have actually already downloaded this script and it is fantastic but I don't think it is the fix I am looking for. Our text files contain a lot of information and what I posted was just a portion. We have about 8 lengthy text file scripts we run on every project, creating 10 or more brochures each day. I was hoping for a clear answer on how to convert them from CS2 to CS5, mainly just what I should replace the All or Once with.

             

            If there isn’t a quick way to do this, I suppose I can go off them line by line, entering the search functions and having them recorded. Then compiling in the end to make the new version?

             

            I attached one of our text files for review if it would help.

             

            Thanks!

             

             

            //This script formats agenda time frames, including AM's and PM's, dashes/hyphens, spacing, breaks, lunches, etc.
            //
            //
            {findText:"  "} {changeText:" "} all
            {findText:"^n"} {changeText:"^p"} all
            {findText:"^s"} {changeText:" "} all
            {findText:" ^t"} {changeText:"^t"} all
            {findText:"^t^t"} {changeText:"^t"} all
            {findText:" ^p"} {changeText:"^p"} all
            {findText:"^t^p"} {changeText:"^p"} all
            {findText:"^p^t"} {changeText:"^p"} all
            {findText:" -"} {changeText:" ^= "} all
            {findText:" - "} {changeText:" ^= "} all
            {findText:" AM^p"} {changeText:" am^p"} once
            {findText:" PM^p"} {changeText:" pm^p"} once
            {findText:" AM^t"} {changeText:" am^t"} once
            {findText:" PM^t"} {changeText:" pm^t"} once
            {findText:" AM "} {changeText:" am "} once
            {findText:" PM "} {changeText:" pm "} once
            {findText:" AM-"} {changeText:" am ^="} once
            {findText:" PM-"} {changeText:" pm ^="} once
            {findText:" am."} {changeText:" am"} once
            {findText:" pm."} {changeText:" pm"} once
            {findText:"a.m."} {changeText:"am"} once
            {findText:"p.m."} {changeText:"pm"} once
            {findText:"0am^p"} {changeText:"0 am^p"} once
            {findText:"5am^p"} {changeText:"5 am^p"} once
            {findText:"0pm^p"} {changeText:"0 pm^p"} once
            {findText:"5pm^p"} {changeText:"5 pm^p"} once
            //
            {findText:" Break"} {changeText:"^tBreak"} all
            {findText:" Lunch"} {changeText:"^tLunch"} all
            //
            //{findText:":00 "} {changeText:":00 pm^t"} once
            {findText:":05 "} {changeText:":05 pm^t"} once
            {findText:":10 "} {changeText:":10 pm^t"} once
            {findText:":15 "} {changeText:":15 pm^t"} once
            {findText:":20 "} {changeText:":20 pm^t"} once
            {findText:":25 "} {changeText:":25 pm^t"} once
            {findText:":30 "} {changeText:":30 pm^t"} once
            {findText:":35 "} {changeText:":35 pm^t"} once
            {findText:":40 "} {changeText:":40 pm^t"} once
            {findText:":45 "} {changeText:":45 pm^t"} once
            {findText:":50 "} {changeText:":50 pm^t"} once
            {findText:":55 "} {changeText:":55 pm^t"} once
            {findText:"pm^tpm"} {changeText:"pm"} once
            //
            {findText:"0am "} {changeText:"0 pm^t"} once
            {findText:"5am "} {changeText:"5 pm^t"} once
            //
            {findText:"0pm "} {changeText:"0 pm^t"} once
            {findText:"5pm "} {changeText:"5 pm^t"} once
            //
            {findText:":00-"} {changeText:":00 pm ^= "} once
            {findText:":05-"} {changeText:":05 pm ^= "} once
            {findText:":10-"} {changeText:":10 pm ^= "} once
            {findText:":15-"} {changeText:":15 pm ^= "} once
            {findText:":20-"} {changeText:":20 pm ^= "} once
            {findText:":25-"} {changeText:":25 pm ^= "} once
            {findText:":30-"} {changeText:":30 pm ^= "} once
            {findText:":35-"} {changeText:":35 pm ^= "} once
            {findText:":40-"} {changeText:":40 pm ^= "} once
            {findText:":45-"} {changeText:":45 pm ^= "} once
            {findText:":50-"} {changeText:":50 pm ^= "} once
            {findText:":55-"} {changeText:":55 pm ^= "} once
            //
            {findText:":00^="} {changeText:":00 pm ^= "} once
            {findText:":05^="} {changeText:":05 pm ^= "} once
            {findText:":10^="} {changeText:":10 pm ^= "} once
            {findText:":15^="} {changeText:":15 pm ^= "} once
            {findText:":20^="} {changeText:":20 pm ^= "} once
            {findText:":25^="} {changeText:":25 pm ^= "} once
            {findText:":30^="} {changeText:":30 pm ^= "} once
            {findText:":35^="} {changeText:":35 pm ^= "} once
            {findText:":40^="} {changeText:":40 pm ^= "} once
            {findText:":45^="} {changeText:":45 pm ^= "} once
            {findText:":50^="} {changeText:":50 pm ^= "} once
            {findText:":55^="} {changeText:":55 pm ^= "} once
            //
            {findText:":00 ^="} {changeText:":00 pm ^= "} once
            {findText:":05 ^="} {changeText:":05 pm ^= "} once
            {findText:":10 ^="} {changeText:":10 pm ^= "} once
            {findText:":15 ^="} {changeText:":15 pm ^= "} once
            {findText:":20 ^="} {changeText:":20 pm ^= "} once
            {findText:":25 ^="} {changeText:":25 pm ^= "} once
            {findText:":30 ^="} {changeText:":30 pm ^= "} once
            {findText:":35 ^="} {changeText:":35 pm ^= "} once
            {findText:":40 ^="} {changeText:":40 pm ^= "} once
            {findText:":45 ^="} {changeText:":45 pm ^= "} once
            {findText:":50 ^="} {changeText:":50 pm ^= "} once
            {findText:":55 ^="} {changeText:":55 pm ^= "} once
            //
            {findText:":00^t"} {changeText:":00 pm^t"} once
            {findText:":05^t"} {changeText:":05 pm^t"} once
            {findText:":10^t"} {changeText:":10 pm^t"} once
            {findText:":15^t"} {changeText:":15 pm^t"} once
            {findText:":20^t"} {changeText:":20 pm^t"} once
            {findText:":25^t"} {changeText:":25 pm^t"} once
            {findText:":30^t"} {changeText:":30 pm^t"} once
            {findText:":35^t"} {changeText:":35 pm^t"} once
            {findText:":40^t"} {changeText:":40 pm^t"} once
            {findText:":45^t"} {changeText:":45 pm^t"} once
            {findText:":50^t"} {changeText:":50 pm^t"} once
            {findText:":55^t"} {changeText:":55 pm^t"} once
            //
            {findText:":00^p"} {changeText:":00 pm^p"} once
            {findText:":05^p"} {changeText:":05 pm^p"} once
            {findText:":10^p"} {changeText:":10 pm^p"} once
            {findText:":15^p"} {changeText:":15 pm^p"} once
            {findText:":20^p"} {changeText:":20 pm^p"} once
            {findText:":25^p"} {changeText:":25 pm^p"} once
            {findText:":30^p"} {changeText:":30 pm^p"} once
            {findText:":35^p"} {changeText:":35 pm^p"} once
            {findText:":40^p"} {changeText:":40 pm^p"} once
            {findText:":45^p"} {changeText:":45 pm^p"} once
            {findText:":50^p"} {changeText:":50 pm^p"} once
            {findText:":55^p"} {changeText:":55 pm^p"} once
            //
            {findText:"0am-"} {changeText:"0 am ^= "} once
            {findText:"5am-"} {changeText:"5 am ^= "} once
            //
            {findText:"0pm-"} {changeText:"0 pm ^= "} once
            {findText:"5pm-"} {changeText:"5 pm ^= "} once
            //
            {findText:"0am^t"} {changeText:"0 am^t"} once
            {findText:"5am^t"} {changeText:"5 am^t"} once
            //
            {findText:"0pm^t"} {changeText:"0 pm^t"} once
            {findText:"5pm^t"} {changeText:"5 pm^t"} once
            //
            {findText:"8:^9^9 pm"} {appliedCharacterStyle:"Found Text"} once
            {findText:"9:^9^9 pm"} {appliedCharacterStyle:"Found Text"} once
            {findText:"10:^9^9 pm"} {appliedCharacterStyle:"Found Text"} once
            {findText:"11:^9^9 pm"} {appliedCharacterStyle:"Found Text"} once
            {findText:"pm", appliedCharacterStyle:"Found Text"} {changeText:"am"} once
            //
            {findText:"a.m."} {changeText:"am"} all
            {findText:"p.m."} {changeText:"pm"} all
            {findText:"am-"} {changeText:"am ^= "} all
            {findText:"pm-"} {changeText:"pm ^= "} all
            {findText:"0am ^="} {changeText:"0 am ^= "} once
            {findText:"5am ^="} {changeText:"5 am ^= "} once
            {findText:"0pm ^="} {changeText:"0 pm ^= "} once
            {findText:"5pm ^="} {changeText:"5 pm ^= "} once
            //
            {findText:" am to ^9"} {appliedCharacterStyle:"Found Text"} once
            {findText:" am to ", appliedCharacterStyle:"Found Text"} {changeText:" am ^= "} once
            {findText:" pm to "} {changeText:" pm ^= "} once
            //
            {findText:"12:00 am"} {changeText:"12:00 pm"} once
            {findText:"12:05 am"} {changeText:"12:05 pm"} once
            {findText:"12:10 am"} {changeText:"12:10 pm"} once
            {findText:"12:15 am"} {changeText:"12:15 pm"} once
            {findText:"12:20 am"} {changeText:"12:20 pm"} once
            {findText:"12:25 am"} {changeText:"12:25 pm"} once
            {findText:"12:30 am"} {changeText:"12:30 pm"} once
            {findText:"12:35 am"} {changeText:"12:35 pm"} once
            {findText:"12:40 am"} {changeText:"12:40 pm"} once
            {findText:"12:45 am"} {changeText:"12:45 pm"} once
            {findText:"12:50 am"} {changeText:"12:50 pm"} once
            {findText:"12:55 am"} {changeText:"12:55 pm"} once
            //
            //
            {findText:"0 am "} {changeText:"0 am^t"} once
            {findText:"5 am "} {changeText:"5 am^t"} once
            {findText:"0 pm "} {changeText:"0 pm^t"} once
            {findText:"5 pm "} {changeText:"5 pm^t"} once
            //
            {findText:"BREAK"} {changeText:"Break"} once
            {findText:"break"} {changeText:"break"} once
            {findText:"LUNCH"} {changeText:"Lunch"} once
            {findText:"lunch"} {changeText:"Lunch"} once
            {findText:"Lunch (on your own)"} {changeText:"Lunch (On Your Own)"} once
            {findText:"Lunch (On your own)"} {changeText:"Lunch (On Your Own)"} once
            {findText:"am^pBreak"} {changeText:"am^tBreak"} all
            {findText:"pm^pBreak"} {changeText:"pm^tBreak"} all
            {findText:"^pLunch^p"} {changeText:"^tLunch (On Your Own)^p"} once
            {findText:"pm Lunch^p"} {changeText:"pm^tLunch (On Your Own)^p"} once
            {findText:"pm^tLunch^p"} {changeText:"pm^tLunch (On Your Own)^p"} once
            //
            {findText:"am^tam "} {changeText:"am^t"} all
            {findText:"am^tam^t"} {changeText:"am^t"} all
            {findText:"am^tam^p"} {changeText:"am^p"} all
            {findText:"pm^tpm "} {changeText:"pm^t"} all
            {findText:"pm^tpm^p"} {changeText:"pm^p"} all
            {findText:"am^tpm "} {changeText:"pm^t"} all
            {findText:"am^tpm^p"} {changeText:"pm^p"} all
            {findText:"pm^tam "} {changeText:"pm^t"} all
            {findText:"pm^tam^t"} {changeText:"pm^t"} all
            {findText:"pm^tam^p"} {changeText:"pm^p"} all
            {findText:"^t^t"} {changeText:"^t^t"} all
            {findText:" ^t"} {changeText:"^t"} all
            {findText:"^t "} {changeText:"^t"} all
            {findText:"^t^="} {changeText:" ^="} all
            {findText:" am^tto"} {changeText:" am ^="} once
            {findText:"pm^tto"} {changeText:"pm ^="} once
            //
            {findText:"^t^p"} {changeText:"^p"} all
            {findText:"^t^t"} {changeText:"^t"} all
            {findText:"  "} {changeText:" "} all
            {findText:" - "} {changeText:" ^= "} all

            • 3. Re: FindChangeByList and associated text files
              Kasyan Servetsky Level 5

              Starting from version CS3, find-change feature changed drastically -- mainly because you can use GREP now. One GREP find-change operation can replace dozens or even hundreds of simple text find-change operations. I think it doesn't make sense to convert all these numerous TEXT lines -- use GREP instead.

               

              And, as far as I know, the CS3/4/5 versions of the script doesn't use All/Once parameter any more.

               

              Kasyan

              • 4. Re: FindChangeByList and associated text files
                L_MATTSON Level 1

                Ok...so I know that there should be a better way to do what we do, i.e. using GREP, but I guess I was hoping that there would a quick Band-Aid to put on the existing ones until I could find out more about that to rewrite. The first part seems to work when I add the appropriate columns but it is the last part with the true/false variables that I struggle with. I don't know which ones to enter to make it work. I guess I will have to look further into GREP and just work my way through.

                 

                Thanks for your help.

                L

                • 5. Re: FindChangeByList and associated text files
                  [Jongware] Most Valuable Participant

                  This are lines from CS4's version of FindChangeByList -- CS5 might have an updated version (although the Find/Change stuff did not change):

                   

                  text {findWhat:" - "} {changeTo:"^="} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all space-dash-space and replace with an en dash.


                  grep {findWhat:"  +"} {changeTo:" "} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.

                  It looks like you could change everything with a fairly advanced text editor (Textpad on the PC, TextWrangler on the Mac -- not TextEdit or Notepad ) using a couple of find/changes.
                  The 'all'/'once' stuff is no longer needed because that was to change, for example, 3 spaces to 2, then 2 to 1, until no 2 spaces were found. With GREP, you can do that "in one go" -- as in, search for "  +" -- two spaces plus a plus -- and replace with a single space. Same with multiple tabs (its GREP notation is "\t", not "^t").
                  A few more "better" ways, using GREP:
                  rather than {findText:" AM^p"}     {changeText:" am^p"}   once
                  use grep {findWhat:"AM$"} {changeTo:"am"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
                  rather than {findText:"^t^p"}     {changeText:"^p"}   all
                  use grep {findWhat:"\t+$"} {changeTo:""} {(..includeFootnotes etc.)
                  Look in your CS5 FindChangeList.txt for more examples.
                  Important: between 'grep'/'text' and the following '{', and between '}'/'{', and after the last one, there should be a single TAB -- not one or more spaces. Seems the script still cannot grok that, even though people have been stymied by it from its very first version.

                  • 6. Re: FindChangeByList and associated text files
                    L_MATTSON Level 1

                    Thank you both for your help…I guess I know what I am going to be doing today… J