Copy link to clipboard
Copied
Dear,
I use findText() to search a string on a existing document !
I works when i use the lenght method it who's me the number fo item fiound.
I want to go the page where it have been find and make selected the text found.
Thanks you for your help !
Hello
I do always this way.
select each result and zoom, you will jump to the page.
var doc = app.documents[0]; app.findTextPreferences = null; //current zoom percentage var zoom_bk = app.activeWindow.zoomPercentage; //keyword app.findTextPreferences.findWhat = "anytext"; //found collection var result = app.findText(); for (var i=0; i < result.length; i++) { result.select(); app.activeWindow.zoomPercentage = 400; //jump to each "anytext" alert(app.findTextPreferences.findWha...
Copy link to clipboard
Copied
Hello
I do always this way.
select each result and zoom, you will jump to the page.
var doc = app.documents[0]; app.findTextPreferences = null; //current zoom percentage var zoom_bk = app.activeWindow.zoomPercentage; //keyword app.findTextPreferences.findWhat = "anytext"; //found collection var result = app.findText(); for (var i=0; i < result.length; i++) { result.select(); app.activeWindow.zoomPercentage = 400; //jump to each "anytext" alert(app.findTextPreferences.findWhat + " was found " + (i+1) + "/" + result.length); }; app.activeWindow.zoomPercentage = zoom_bk;
mg
Copy link to clipboard
Copied
Thank you !