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

How to refresh the document window?

Community Expert ,
Sep 25, 2018 Sep 25, 2018

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
2.1K
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

correct answers 2 Correct answers

Enthusiast , Sep 26, 2018 Sep 26, 2018

Hi Klaus,

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

Translate
Community Expert , Sep 26, 2018 Sep 26, 2018

Redisplay (); // Lowercase d

Reformat (); // Lowercase f

Translate
Engaged ,
Sep 25, 2018 Sep 25, 2018

Hi Klaus,

On document Level there are two functions

ReDisplay();

ReFormatting();

Does this help?

Markus

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 25, 2018 Sep 25, 2018

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).

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 26, 2018 Sep 26, 2018

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.

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 26, 2018 Sep 26, 2018

Hi Klaus,

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

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 26, 2018 Sep 26, 2018

Redisplay (); // Lowercase d

Reformat (); // Lowercase f

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 26, 2018 Sep 26, 2018
LATEST

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 ();

}

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