for the first question you may use Function for every search and call one by one at end of every function..and use confirm to go for the next find and replace
If you look in the code, you can see the functions "myFindText", "myFindGrep" and "myFindGlyph" all store the results of the actual
myObject.changeXXX(..)into a variable called
myFoundItems. This will thus be an array of the changed text (and it's not used anywhere. Oh well, these are just example scripts.). The number of changes is thus the length of the array: myFoundItems.length.
1. add a global variable at the top, before the line 'main()':
var NumberOfChanges = 0;
2. at the end of each of the myFindXXX routines, add a line
NumberOfChanges += myFoundItems.length;
3. add an alert at the top, after the line 'main()':
alert ("Number of changes made: "+NumberOfChanges);
Not tested but it ought to work.
Unfortunately, the Adobe programmers did not add commands for 'find next' and 'change, find next' to its scripting interface. You can Find All or Change All, nothing else. It is possible to use a Find All first, and then loop over its results and manually picking which occurrences to change, but every time you change something, the entire previously found list is invalidated! There is no easy way to 'continue' searching from any random starting point either (and frankly, that seems a recurring problem for Adobe's programmers, because in the interface itself it's also quite erratic at times!).
Can you tell us more on what the background of your question is?
Thanks so much, Jongware.
I guess I would like a bit more reportage and control while I burn through a text cleanup. I would like the ability to look at each potential change, and have the option to skip one sometimes. I would like to be able to say that I saw each and every change the script made, and thus I would know a bit better that I have not inadvertently added unnoticed mistakes into the text cleanup.
I added your 3 bits of code to my own "FindChangeByListPlus2016.jsx" file. This is an improved version relative to the one that ships pre-installed with InDesign (which has a few shortcomings). In adding your three lines of code, it now finishes with a dialog box message window that informs the total number of changes made.
That is a step in the right direction! Thanks. I will make it available for download for free from my website.