Copy link to clipboard
Copied
Hi everyone,
Here is what I want to do. I have a script that find/replace in all my document. It runs for half an hour, line by line. But InDesign stays on the same page all this time, so I can't see where it is, what it changes LIVE. I want to know if there is a trick that will make the screen follow the selected text that need to be change, so I can see it.
Thanks in advance,
Olivier
Copy link to clipboard
Copied
Hi Olivier!
Calling the "select()" method might result in what you want.
The following selects a text frame in my test document, and it also shows the page that the object is on, if another page is in view:
app.activeDocument.pageItems.itemByID(207050).select()
(Of course "207050" is a valid id for one of the objects in my open document)
So if you have a result of "found objects", you could possibly juist call the ".select()" method for each object that you would like to set focus to.
Sometimes "Enable redraw" needs to be checked, from the popout menu of the script palette. I'm not sure that's the case here though.
Best regards,
Andreas Jansson
Message was edited by: Andreas Jansson
Copy link to clipboard
Copied
Hi Mr. Jansson !
First, thanks for your answer. I already select text inside a text frame, I do not select a text frame completely. Maybe it's the reason why my screen don't follow the selected item?<
Thanks,
Olivier
Copy link to clipboard
Copied
Hi,
You need to call a text.showText() method which jumps to this text.
Jarek
Copy link to clipboard
Copied
Have you tried:
app.activeWindow.activePage = myPage?
You could set myPage to app.selection[0].parentTextFrames[0].parentPage
Dave
Copy link to clipboard
Copied
I'll reply to you all soon, thanks for your answers ! My script is running right now and I can't stop in the middle.
Olivier
Copy link to clipboard
Copied
Showing what the script does slows it down incredibly. Why not add a simple progress bar?
Peter
Find more inspiration, events, and resources on the new Adobe Community
Explore Now