Skip to main content
K.Daube
Community Expert
Community Expert
July 4, 2016
Answered

Screen refresh triggers document change

  • July 4, 2016
  • 1 reply
  • 533 views

Dear all,

In my script I have set up this notification:

Notification (Constants.FA_Note_PostActiveDocChange, true); 


I have now noticed that this is also triggered (executing the Note function) in the following situation:

  • Script is active in a dialgogue, which stays open (is palette). It remembers the 'current' location in the user document to be able to restore it after changes in the document by the script.
  • I switch to the document and do some text editing. Normally I do not need a screen refresh and can then proceed to the palette of the script.
  • If I do a screen refresh (CTRL +l) the notification triggers and the script restores the last 'current location'. In most cases this is the start of the document.

My questions are:

  • Is a sceen referesh really a 'change in the document' and thus the behaviour correct?
  • Or is this my mis-interpetation of FA_Note_PostActiveDocChange ?
  • Or am I the victim of an unsharp defintion of FA_Note_PostActiveDocChange ?

Thanks for any thoughts about this.

Klaus

This topic has been closed for replies.
Correct answer K.Daube

There seem to be some hidden conditions which set the 'dirty flag'.

I tested the following with a new (empty) document and assured that the save icon is dimmed (document is 'clean').

The document is considered changed (save icon is lit).

  • Screen refresh by CTRL+l or via menu
  • Switch to master pages - or back to body pages
  • Switch to reference paes - or back to body pages

It turns out that this happens since FM 7.2.

Switching between page types in a script using FCodes does not change the 'dirty flag'.

A simple script reading from the reference page does not change the 'dirty flag'.

I have carefully checked the complete script - the flag is set as soon as the dialgoue is set up complete and becomes visible.

So I will leave the things as they are and do not further investigat in the script.

Thanks for listening!

1 reply

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthorCorrect answer
Community Expert
July 11, 2016

There seem to be some hidden conditions which set the 'dirty flag'.

I tested the following with a new (empty) document and assured that the save icon is dimmed (document is 'clean').

The document is considered changed (save icon is lit).

  • Screen refresh by CTRL+l or via menu
  • Switch to master pages - or back to body pages
  • Switch to reference paes - or back to body pages

It turns out that this happens since FM 7.2.

Switching between page types in a script using FCodes does not change the 'dirty flag'.

A simple script reading from the reference page does not change the 'dirty flag'.

I have carefully checked the complete script - the flag is set as soon as the dialgoue is set up complete and becomes visible.

So I will leave the things as they are and do not further investigat in the script.

Thanks for listening!