Skip to main content
Marcos_Suárez
Known Participant
February 22, 2010
Answered

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

  • February 22, 2010
  • 1 reply
  • 742 views

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

This topic has been closed for replies.
Correct answer Kasyan Servetsky

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

1 reply

Marcos_Suárez
Known Participant
February 22, 2010

It`s there anybody here?

Thanks...

Jongware
Community Expert
Community Expert
February 22, 2010

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.