Screen refresh triggers document change

Advocate ,
Jul 04, 2016

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

321

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

Advocate , Jul 11, 2016
K.Daube Advocate , Jul 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 menuSwitch to master pages - or back to body pagesSwitch to reference paes - or back to body pagesIt 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 si...

Likes

Translate

Translate
Jump to answer Jump to answer
Advocate ,
Jul 11, 2016

Copy link to clipboard

Copied

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!

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