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

Weird behaviour of palette

Community Expert ,
Aug 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

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.

TOPICS
Scripting

Views

111

Translate

Translate

Report

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 1 Correct answer

Community Expert , Aug 26, 2022 Aug 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" ...

Votes

Translate

Translate
Community Expert ,
Aug 25, 2022 Aug 25, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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 ,
Aug 26, 2022 Aug 26, 2022

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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