If you only need to identify through CS3, you can open the file and
search for: <xap:CreatorTool>Adobe InDesign \d
The number at the end of the string will be the version number (3, 4,
In CS4, they changed the format of the identifier and it's now :
<xmp:CreatorTool>Adobe InDesign 6.0</xmp:CreatorTool> instead of:
<xap:CreatorTool>Adobe InDesign 5.0</xap:CreatorTool> (i.e. xmp
instead of xap). You'll need to adjust your search accordingly...
Probably a RegEx something like this is the way to go...
/<x(a|m)p:CreatorTool>Adobe InDesign \d/
You can get the version from this code.
True, but that only helps once the file is opened...
Without opening the file how can we find, which version it is?
Read my earlier response...
Maybe I should clarify what I meant a bit...
There's opening the File object as in
var fileString = file.read();
result = fileString.match(/<x(a|m)p:CreatorTool>Adobe InDesign \d/);
var fileVersion = result[result.length-1];
And then there's opening the document as in app.open(myDoc)...
I meant to do the first and not the second.
[Edit: There was a typo in the "result=..." line which I fixed...]
I didn't catch your earlier response, I think you also opening the file!!!!!!!!!
>I think you also opening the file!!!!!!!!!
Yes, but not in InDesign.
I'm not sure if I'm not understanding you or you're not understanding me...
If you are looking through a folder of files and only want to use files from a specific version, the last thing you are going to want to do will be open each file in InDesign. I understood that this is what the OP was trying to avoid.
Opening and closing a file in InDesign can take a long time - especially if there are many of them.
Also, each time you open a file in InDesign, the program uses a bit more memory. If you open and close enough files (while doing nothing else!) you will eventually crash InDesign due to a lack of RAM...