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

FA_Note_PostActiveDocChange - strange happening

Community Expert ,
Jan 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

Dear friends,

In my script I have a Notify function to react on certain events.
I have now discovered that FA_Note_PostActiveDocChange triggers although I have only one file open.
Notify is invoked after leaving a function (which works on the document) and just climbing up the return ladder:

Leaving HandleCalcMarkers
Leaving Command
FA_Note_PostActiveDocChange triggered

FA_Note_PostActiveDocChange is not explained in the FDK reference. Adobe FrameMaker Scripting Guide only mentions it: (Constants.FA_Note_PostActiveDocChange int Value: 105).

My understanding of this constant is that it triggers when I switch from one open document to another. I do not understand why it can trigger with only one document open.

Although this behaviour does not create (as far as I see) any negative effect in the script, I'm suspicious...

TOPICS
Scripting

Views

301

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

Engaged , Jan 18, 2017 Jan 18, 2017

Hi Klaus,

AFAIK some pods and Dialog are based on FM documents. On possible explanation could be switching from one pod back to the document could fire this event.

Check sparm. If I remember correctly in such case sparm is empty.

Markus

Votes

Translate

Translate
Engaged ,
Jan 18, 2017 Jan 18, 2017

Copy link to clipboard

Copied

Hi Klaus,

AFAIK some pods and Dialog are based on FM documents. On possible explanation could be switching from one pod back to the document could fire this event.

Check sparm. If I remember correctly in such case sparm is empty.

Markus

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 ,
Jan 21, 2017 Jan 21, 2017

Copy link to clipboard

Copied

LATEST

Thanks, Markus, for this tip!

In the meantime I have discovered that Constants.FA_Note_PostActiveDocChange is also 'triggered' by inserting a new row into a table. To there may be many cases in which this is event is triggered.

Unfortunately there is no difference between the information in Notify for real document and change and these pseudo-changes:

Notify triggered iNote= 105 sParm= null iParm= 0

So how to verify a real change of document?

    case Constants.FA_Note_PostActiveDocChange:   // 105 active document has changed
      if (object.Name !== glbl.oCurrentDoc) {
        UpdateDialogues (object);
      }
      break;

This seems to work.

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