3 Replies Latest reply on Jul 5, 2015 7:43 AM by rombanks

    Extendscript: demystifying the book compare function

    rombanks Level 1

      Hello fellows,

       

      I was trying to make the book.Compare() function work in the same way as the corresponding GUI option, but it seems that in the ES, this function works differently. Instead of comparing all book components and creating CMP files, it seems to only compare the structure of the book itself and it even doesn't create the bookCMP file. The Adobe scripting guide does not provide much information about the function and its result (how surprising...).

       

      So, just for a test, I created the following script:

       

      #target framemaker

      var book1, book2, flags, cmp

       

      book2 = SimpleOpen ("OldBook", true);

      book1 = SimpleOpen ("NewBook", true);

      flags = Constants.FF_CMP_CHANGE_BARS | Constants.FF_CMP_COMPKIT | Constants.FF_CMP_SUMKIT;

       

      cmp = book1.Compare(book2, flags, "Inserted", "Deleted", null, 0);

       

      As the outcome, the script only opens the summary file listing the structure differences between the 2 books. It does not create the bookcomponent CMP files (as the GUI option does). I can check the CompareRet object properties, but that's about it.

      Any idea how to create the bookcomponent CMP files and open them?

       

      Thank you for your input in advance!