Message Board for Rorohiko Workflow Resources | |
https://www.rorohiko.com/cgi-bin/yabb2/YaBB.pl
General Category >> General Board >> How to use 10008 and 10009 call extensions? https://www.rorohiko.com/cgi-bin/yabb2/YaBB.pl?num=1256297489 Message started by Kasyan on 10/23/09 at 23:31:29 |
Title: How to use 10008 and 10009 call extensions? Post by Kasyan on 10/23/09 at 23:31:29
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):
And here is the result I got in console — theDoc1 and theDoc2 reference to the same document :o : [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[/code] 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 |
Title: Re: How to use 10008 and 10009 call extensions? Post by Harbs on 10/24/09 at 00:06:04
You didn't do anything wrong.
There's currently no way around this bug... :'( |
Title: Re: How to use 10008 and 10009 call extensions? Post by Harbs on 10/24/09 at 00:29:11
Just a bit of further clarification:
As it turns out, the bug is not in the reference to the document, but rather in the way InDesign creates the collections from the document references. So even though the UID give you correct references, it doesn't help when you try to access collections within that document. If you use doc.labeledPageItems(), you will get the ones from the correct document. It's just the collections which have this problem. You can try comparing the documents using doc.labeledPageItems("*")... |
Title: Re: How to use 10008 and 10009 call extensions? Post by Kasyan on 10/24/09 at 02:31:40
Thank you for the explanation, Harbs.
When I was writing my 'Compare two documents' script I've noticed that something really bizarre is happening to the documents collection. Kasyan |
Title: Re: How to use 10008 and 10009 call extensions? Post by Kris Coppieters on 10/24/09 at 07:26:17
Hi Kasyan,
I did a bit of digging in my e-mail archive - here's the relevant info snatched from an old e-mail: Quote:
If I remember correctly, you should run the above script with two same-name documents open in InDesign, each with two dummy page items in them. |
Title: Re: How to use 10008 and 10009 call extensions? Post by Kasyan on 10/24/09 at 07:33:11
Thank you, Kris.
|
Message Board for Rorohiko Workflow Resources » Powered by YaBB 2.5.2! YaBB Forum Software © 2000-2024. All Rights Reserved. |