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

Extendscript: demystifying the book compare function

Participant ,
Jul 02, 2015 Jul 02, 2015

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!

TOPICS
Scripting
538
Translate
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 ,
Jul 02, 2015 Jul 02, 2015

Hi Roman, I haven't done this with ExtendScript, but in FrameScript you have to programmatically open each corresponding document in each book and run the compare at the document level. I think that is the only way to get the level of detail that you normally get from the GUI. You could check the FDK docs and see if there are more details about the process. -Rick

Translate
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
Participant ,
Jul 02, 2015 Jul 02, 2015

Hi Rick,

I considered running doc.compare() as you've mentioned, but I first wanted to see if this function works at the book level. It seems that it doesn't.

It's not clear to me how to further utilize the CompareRet object that is the result of the function execution. I've checked the corresponding FDK function, but of course the syntax in this IDE is different and I am not sure if a working example is provided there.

Thanks,

Roman

Translate
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
Participant ,
Jul 05, 2015 Jul 05, 2015
LATEST

It's a pity that the Adobe guys do not monitor this forum and don't answer questions as well. Shame...

Translate
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