Skip to main content
Vamitul
Legend
Sep 19, 2013 7:52 AM UTC
Answered

a quick question, how to call from a script "force redraw"?

For "debuging" purposes, i want to call from a script a "force redraw" of the current layout window (default keyboard shortcut Shift+F5). I can't find anything like that in the DOM, and i was thinking of invoking a menu.. but can't find the menu item for it either..

anyone?

This topic is closed to new replies. Start a new post to keep the conversation going.
LaubenderCorrect answer
Community Expert
Sep 19, 2013 10:32 PM UTC

Or maybe minimizing, maximizing the specific layoutWindow of the document?

"Force Redraw" should be available by its ID value 318:

//Invoke the menu "Force Redraw":

try{app.scriptMenuActions.itemByID(318).invoke()}catch(e){$.writeln(e.message)};

Uwe

11 replies

wckdtall
Inspiring
Mar 23, 2023 2:30 AM UTC

I'm trying to add a page refresh to a script of mine, and it doesn't seem to be working in a loop:

for(i = 0;i<5;i++){
app.activeWindow.activePage = app.activeDocument.pages[i];
$.sleep(2000);
try{app.scriptMenuActions.itemByID(318).invoke()}catch(e){$.writeln(e.message)};
}

Are there any methods that would allow the document to refresh after navigating to each page and pausing for a few seconds? Just a nice to have in the script.

Translate
Peter Kahrel
Community Expert
Community Expert
Sep 19, 2013 3:00 PM UTC

Maybe recompose something (a text frame or something like that). Does that work?

Or juggle with the screen mode:

app.windows[0].screenMode = ScreenModeOptions.PREVIEW_OFF

app.windows[0].screenMode = ScreenModeOptions.PREVIEW_TO_BLEED

Never done this: I usually try to prevent screen redraws!

Peter

Translate
LaubenderCommunity ExpertCorrect answer
Community Expert
Sep 19, 2013 10:32 PM UTC

Or maybe minimizing, maximizing the specific layoutWindow of the document?

"Force Redraw" should be available by its ID value 318:

//Invoke the menu "Force Redraw":

try{app.scriptMenuActions.itemByID(318).invoke()}catch(e){$.writeln(e.message)};

Uwe

Translate
Vamitul
VamitulAuthor
Legend
Sep 20, 2013 8:50 AM UTC

Thanks Uwe.

@Peter: I don't dare recompose anything, as this script is basicly a helper tool for a last visual inspection of the document, before signing it off. The screenmode toogleing creates a huge visual flicker, that mostly defeats the purpose of fast previewing the document, and if the document is large enough will give you a headache at least (at most it will make you spill your lunch).

Translate