Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Can I make the screen follow where my script is? Clarification in comments.

New Here ,
Sep 27, 2013 Sep 27, 2013

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

TOPICS
Scripting
996
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 27, 2013 Sep 27, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 27, 2013 Sep 27, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 27, 2013 Sep 27, 2013

Hi,

You need to call a text.showText() method which jumps to this text.

Jarek

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 27, 2013 Sep 27, 2013

Have you tried:

app.activeWindow.activePage = myPage?

You could set myPage to app.selection[0].parentTextFrames[0].parentPage

Dave

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 27, 2013 Sep 27, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 28, 2013 Sep 28, 2013
LATEST

Showing what the script does slows it down incredibly. Why not add a simple progress bar?

Peter

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines