How to refresh the document window?

Advocate ,
Sep 25, 2018

Copy link to clipboard

Copied

At the end of my lenghthy script the display of the document does not reflect the work of the script.

I always must type CTRL+l to refresh the display.

Now I tried to use this function:

function ZRefresh() { // === Refresh screen =======================================================

  FcodeList = new Array(FCodes.KBD_REFRESHWIN);

  Fcodes(FcodeList);

}

But this does not the trick - I still need to use the keyboard myself...

Any suggestions?

Maybe a function to switch to master pages and back (igrnoring overwrites).

Better approches?

TOPICS
Scripting

Views

707

Likes

Translate

Translate

Report

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

1 Correct Answer

Adobe Community Professional , Sep 26, 2018
frameexpert Adobe Community Professional , Sep 26, 2018
Redisplay (); // Lowercase dReformat (); // Lowercase f

Likes

Translate

Translate
Jump to answer Jump to answer
Engaged ,
Sep 25, 2018

Copy link to clipboard

Copied

Hi Klaus,

On document Level there are two functions

ReDisplay();

ReFormatting();

Does this help?

Markus

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
K.Daube AUTHOR
Advocate ,
Sep 25, 2018

Copy link to clipboard

Copied

Thank You, Markus,

app.ActiveDoc.ReFormatting(); did it!

Maybe CTL+l is the equivalent to ReFormatting() and not to ReDisplay(), which has no effect in my case.

But... also this works only randomly...

ExtendScript seems to be a simulation of a gambling hall (at least in my current perception).

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
K.Daube AUTHOR
Advocate ,
Sep 26, 2018

Copy link to clipboard

Copied

Sorry Markus to tell you this:

// RefreshDisplay.jsx ============================ UTF-8 =========

//            Refresh document display

// Environmnt FM-14, ES-toolkit CC (4.0.0.1) ES 4.5.5

app.ActiveDoc.ReDisplay(); // app.ActiveDoc.ReDisplay is not a function

app.ActiveDoc.ReFormat();  // app.ActiveDoc.ReFormat is not a function

My previous comment about randomness came from the fact that I did not look into the console log, where this error message was all the time for both methods.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Enthusiast ,
Sep 26, 2018

Copy link to clipboard

Copied

Hi Klaus,

just use Reformat() and Redisplay() instead of ReFormat() and ReDisplay()

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Sep 26, 2018

Copy link to clipboard

Copied

Redisplay (); // Lowercase d

Reformat (); // Lowercase f

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
K.Daube AUTHOR LATEST
Advocate ,
Sep 26, 2018

Copy link to clipboard

Copied

Ah, Rick - even in in Klaus Göbel's post I didnt grab it! Staring to long on code lines makes blind.

I already had a verbose alternative - which I now don't need:

function RefreshDisplay () { // === Refresh document display ======================================

// Called by  FMbiblio >

// Comment    The following does nothing at all:

//              FcodeList = new Array(FCodes.KBD_REFRESHWIN);

//              Fcodes(FcodeList);

// TestEnv. FM-14, ES-toolkit CC (4.0.0.1) ES 4.5.5

  oDoc = app.ActiveDoc

  oMasterPage = oDoc.FirstMasterPageInDoc;

  oTextFrame = oDoc.NewTextFrame (oMasterPage.PageFrame);

  oTextFrame.Delete ();

}

Likes

Translate

Translate

Report

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