Skip to main content
K.Daube
Community Expert
Community Expert
August 23, 2022
Answered

Weird behaviour of palette

  • August 23, 2022
  • 1 reply
  • 254 views

Dear wise women and men:

My script FMfindReplace opens a palette wPalF via menu or short cut. The scipt is started either via the Script Library or by placing it in the Statup folder.

  1. I have several documents open and invoke the script via ESC q f
  2. It works as intended on document A, Notify reacts and does was it should, all OK
  3. I close the palette via the Exit button top right or via the button OK/Done
  4. Now I switch to another document B and the palette re-appears! Console log (see Notify hereafter): wPalF.active = true
  5. I close the palette and give focus to another application (test editor) and then come back to the document B
  6. Now the palette is really gone and for further work with it I invoke it with the short cut... (Console log: wPalF.active = false).

I do not understand why the palette re-appears in step 4. I have not observed such behaviour in any other of my scripts with palettes...

The Notify function is IMHO streight forward:

 

  case Constants.FA_Note_PostActiveDocChange:
    if (object.ObjectValid()) {                 // change of document
      KLD_F.oCurrentDoc = object;
Console ("wPalF.active = " + wPalF.active);
      if (wPalF.active)  {
        KLD_F.bDocActive = true;
        KLD_F.bBookActive = false;
        wPalF.g07.rbDoc.value = true;
        KLD_F.ButtonReset();
      }
    }

 

There exist notification constants for which no explanations are in the FDK documentation:

FA_Note_Dialog (84); FA_Note_Alert (85); FA_Note_Palette (86); ... FA_Note_FileOpen (94)
For curiosity I set up notification for FA_Note_Palette  - it did not trigger during my actions.

positive

The palette also re-appears if I open another palette defined by scripts in Statup.

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

Once more the solution is: KISS - Keep It Simple and  Stupid.

Reducing the trigger to just one (namely FA_Note_PostActiveDocChange let me change the document without re-appearing the panel after it had been closed.

There is still some fine-tuning reuired for the situation after "item not found any more" ...

1 reply

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthor
Community Expert
August 25, 2022

I have searched for vagabonding globals and other possible causes, but found nothing which explains the behaviour.

So i just write it off under the heading Known Issues ...

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthorCorrect answer
Community Expert
August 26, 2022

Once more the solution is: KISS - Keep It Simple and  Stupid.

Reducing the trigger to just one (namely FA_Note_PostActiveDocChange let me change the document without re-appearing the panel after it had been closed.

There is still some fine-tuning reuired for the situation after "item not found any more" ...