Hi all,
Recently I wrote a script compares two documents and finds the differences between them. However I stumbled upon a problem: it doesn’t work when the documents have identical names but saved in different locations. It’s often the case in my workflow, since I want to compare two versions of a file: one is being accessed over the network on a remote volume on my G5 while the other is local in my backup folder.
I remembered that the latest version of APID has new ‘callExtensions’: kOpcode_GetDocGUID and kOpcode_FindDocGUID.
So, I made a little test, but it didn’t work for me:
I opened two documents, both have the same name — Sample1.indd — one from hard drive, another from flash drive — and run the following script:
Code:var myDoc1 = app.documents[0];
var myDoc2 = app.documents[1];
$.writeln("myDoc1.fullName - " + myDoc1.fullName.fsName);
$.writeln("myDoc2.fullName - " + myDoc2.fullName.fsName);
guid1 = app.callExtension(0x90B6C, 10008, myDoc1);
guid2 = app.callExtension(0x90B6C, 10008, myDoc2);
$.writeln("guid1 - " + guid1);
$.writeln("guid2 - " + guid2);
var theDoc1 = app.callExtension(0x90B6C, 10009, guid1);
var theDoc2 = app.callExtension(0x90B6C, 10009, guid2);
$.writeln("theDoc1.fullName - " + theDoc1.fullName.fsName);
$.writeln("theDoc2.fullName - " + theDoc2.fullName.fsName);
And here is the result I got in console — theDoc1 and theDoc2 reference to the same document

:
Code:myDoc1.fullName - D:\DeleteMe\Sample1.indd
myDoc2.fullName - H:\My Current Scripts\Compare Documents\Sample1.indd
guid1 - {0466c13e-fdce-0e81-afa92805b47cead9}
guid2 - {a1b5aa61-81a6-a333-0ee1b3b312cb9830}
theDoc1.fullName - D:\DeleteMe\Sample1.indd
theDoc2.fullName - D:\DeleteMe\Sample1.indd
What did I wrong?
What is the difference between the ‘
front doc GUID’ —
kOpcode_FrontDocGUID and the ‘
active doc GUID’
kOpcode_ActiveDocGUID? I thought that active document and front document are synonyms.
Thank you in advance.
Kasyan