find/change script highlight found text
Hello,
I've written this script and it works great. But what I'd like to do is go through each found word individually (like in the find/change dialog with the button 'find next').
This is a snippet:
app.findTextPreferences=app.changeTextPreferences=null;
var what = app.findTextPreferences.findWhat="ensure";
app.changeTextPreferences.changeTo="make sure";
var found =app.activeDocument.changeText();
if (found.length=1){
alert(found.length+" instance of 'ensure' was changed");
}else{
alert(found.length+" instances of 'ensure' were changed");
}
I want the script to make each instance of "ensure" my active selection so I can see where they are before I change them.
Thanks ![]()