5 Replies Latest reply on Feb 22, 2010 2:06 PM by Marcos Suárez

    Add every search to "FindChangeList.txt"...

    Marcos Suárez Level 1

      It´s possible a script for "add" every search at last of the "FindChangeList.txt" of "FindChageByList.jsx", but whithout copy/paste ("RecordFindChange_CS3_Kas.jsx"): only run the script after every search for add it...

      Thanks for read me...

        • 1. Re: Add every search to "FindChangeList.txt"...
          Marcos Suárez Level 1

          It`s there anybody here?

           

          Thanks...

          • 2. Re: Add every search to "FindChangeList.txt"...
            [Jongware] Most Valuable Participant

            Well, your actual question is a bit hard to understand. Sorry ...

             

            I think you are looking for a way to adjust FindChangeByList without using the super-neat script that translates an actual InDesign Replace operation into the notation required.

             

            The problem is, it's just the other way around. If you open FindChangeList.txt, you will see the actual notation that Adobe expected us to use when changing the list. Yes, you can change the list using Notepad (or Textedit or something similar) but you have to take exceptional care to use the exact notation that the script expects. Anything off, and the script simply will not work.

             

            So Martin Fisher wrote a very clever script that converts your search action to the format expected by the FindChangeByList script -- but of course there is a catch. You can only examine a search action after it has been "used" by InDesign, so yes, if you do want to use this, you have to use the actual search once (or that's how I believe it works).

             

            If you don't want to use the script, edit FindChangeList.txt manually.

            • 3. Re: Add every search to "FindChangeList.txt"...
              Kasyan Servetsky Level 5

              Hi Marcos,

               

              I don't have access to InDesign right now, so I can't check if it works, but I suggest you to make a couple of minor changes to RecordFindChange script:

              change

              var myData = collectData(); 
              writeData ( myData ); 

              to

              var myData = "\r" + collectData(); 

              WriteToFile(aData);

               

              and use this function

               

              function WriteToFile(myText) {
                  myFile = new File("/C/Program Files/Adobe/Adobe InDesign CS3/Scripts/Scripts Panel/Samples/JavaScript/FindChangeSupport/FindChangeList.txt");
                  if ( myFile.exists ) {
                      myFile.open("e");
                      myFile.seek(0, 2);
                  }
                  else {
                      myFile.open("w");
                  }
                  myFile.write(myText);
                  myFile.close();
              }

               

              instead of WriteToFile()

              myFile should point to your FindChangeList.txt file

               

              Kasyan

              • 4. Re: Add every search to "FindChangeList.txt"...
                Marcos Suárez Level 1

                Ok... I will try this tomorrow and report you...

                 

                Thanks...

                • 5. Re: Add every search to "FindChangeList.txt"...
                  Marcos Suárez Level 1

                  I try, but the script don't work...

                  But I change (aData) to (myData), and it work great !!!

                   

                  A lot thanks...

                   

                  Kasyan Servetsky wrote:

                   

                  Hi Marcos,

                   

                  I don't have access to InDesign right now, so I can't check if it works, but I suggest you to make a couple of minor changes to RecordFindChange script:

                  change

                  var myData = collectData(); 
                  writeData ( myData ); 

                  to

                  var myData = "\r" + collectData(); 

                  WriteToFile(aData);

                   

                  and use this function

                   

                  function WriteToFile(myText) {
                      myFile = new File("/C/Program Files/Adobe/Adobe InDesign CS3/Scripts/Scripts Panel/Samples/JavaScript/FindChangeSupport/FindChangeList.txt");
                      if ( myFile.exists ) {
                          myFile.open("e");
                          myFile.seek(0, 2);
                      }
                      else {
                          myFile.open("w");
                      }
                      myFile.write(myText);
                      myFile.close();
                  }

                   

                  instead of WriteToFile()

                  myFile should point to your FindChangeList.txt file

                   

                  Kasyan