0 Replies Latest reply on Feb 24, 2017 4:43 AM by easypay_mdb

    ExtendScript RH, Post- en Pre-events

    easypay_mdb Level 1

      I'm having trouble with understanding the combination

      ExtendScript <-> event-triggering (RH version 2015 and 2017).

       

      Pre => perform actions by running a script before an event.

      Post => perform actions by running a script after an event.

       

      For example the event postworddocupdate.

      I use the file 'RHWordDocs.apj’ in my script for the following reason.

      I have a project with multiple linked Word-documents.

      When I update a linked Word-document or generate an extra linked Word-document, I only want to check/alter the topics of the selected Word-document.

       

      See the results in this report below, made for a project with one linked Word-document.

      -------------------

       

       

      Word-document linked and pressed <ctrl + F5> to ‘generate’ document.

      Content of the file ‘RHWordDocs.apj’

      My script starts running by the event (postworddocupdate)

      After pressing the ‘OK’ button (einde script), we get the following message.  ('einde' is dutch for 'end')
      In English: “The file has been changed, would you like to load it again.”

      Content of the file ‘RHWordDocs.apj’ is altered. This block is set extra.

      … etc.

       
      Also
         <asciionlyfilenames>1</asciionlyfilenames>  => put to 1, due of the ‘project settings’.

       

       

       

      When I update my Word-document:
      Again my script starts running by the event (postworddocupdate).

      This time my script can check/alter the listed topics.

      After pressing the ‘OK’ button (einde script), we get the following message.
      In English: “The file has been changed, would you like to load it again.”

      This time no changes in the file ‘RHWordDocs.apj’.

       

      Conclusion:
      Not a good idee to use the file ‘RHWordDocs.apj’,as base to check/alter the topics (htm-pages).

      I would have assumed that building the file 'RHWordDocs.apj' is part of the worddocupdate.

       

      Disadvantages:

      Because the file ‘RHWordDocs.apj’ is altered after running the script.
      - The script doesn’t work fine when you ‘generate’ a Word-document.
      - The script doesn’t work fine when you 'update' a Word-document, after the original Word-document is changed and results in new topics within Robohelp.

       

       

       

      Is there a way to be sure that everything is updated before running the customed script?

      Is there an other way to solve this?

       

       

       

       

      Ps: I also had the same problem with using the event ‘preSSLgenerate’. My script was interrupted by the SSL-generating actions that should start after running my script.