FA_Note_PostActiveDocChange - strange happening

Advocate ,
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

207

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

Engaged , Jan 18, 2017
Wiedenmaier Engaged , 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

Likes

Translate

Translate
Jump to answer Jump to answer
Engaged ,
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

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
K.Daube AUTHOR LATEST
Advocate ,
Jan 21, 2017

Copy link to clipboard

Copied

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.

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