0

I’m writing a script that searches the active document for some word with specific properties, then highlights it.

After performing the operation at the user’s command, I’d like to bring the affected word into view, so that the user doesn’t have to search through the document to find it.

I tried selecting it, but this does not seem to move the text in the window.

  • 1
    I don't have the code for this but did it years ago. after selecting,change window properties and increase zoom by 1, then decrease to original value. – user1754036 Jul 10 '19 at 13:08

1 Answers1

1

Based on user1754036’s suggestion, I tried the following, which is good enough for my case:

myText.select();
app.activeWindow.zoom(ZoomOptions.SHOW_PASTEBOARD);
app.activeWindow.zoom(ZoomOptions.ZOOM_IN);
app.activeWindow.zoom(ZoomOptions.ZOOM_IN);
app.activeWindow.zoom(ZoomOptions.ZOOM_IN);