Hi Dave,
Make that three or four... ;)
Kris at Rorohiko created a method to get unique references to two
different documents with the same name. It's usable if you have the free
APID ToolAssistant version 1.0.44 or higher. (it doesn't need to be
licensed...)
Here's an excerpt from the reference manual:
The get doc GUID function is used as follows:
guid =
app.callExtension(0x90B6C,10008,document);
This function returns a GUID (Globally Unique Identifier) for a
document. This is a string of the form
{nnnnnnnn-nnnn-nnnnnnnnnnnnnnnnnnnn}
where all 'n' stand for a hexadecimal digit.
These GUID allow you to work with same-name documents that
are concurrently open without getting tangled in the confusion
that occurs when using resolve calls.
As long as a document is not moved from its original location on
disk, it will keep the same GUID. Two documents with the same
name but different paths will have different GUID.
Opening, closing, (re)saving to the same location will NOT
change the GUID.
Moving a document to another location will change the GUID.
The find open doc by GUID function is used as follows:
doc = app.callExtension(0x90B6C,10009,guid);
This function retrieves a reference to an already open document
based on its GUID string.
These GUID strings are unique and persistent and allow
persistent references to same-name documents without resolvelike
issues (but the documents are meant to be 'unmovable' i.e.
they cannot be renamed or moved to another folder). Once the
document is open, it can be retrieved via its GUID.
HTH,
Harbs
... View more