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

Identify the Application Version Cs/Cs2/Cs3???

Contributor ,
Feb 25, 2010 Feb 25, 2010

Hi All,


I need to identify the Application Version [Cs/Cs2/Cs3].


Is there any way to identify using javascript???


Regards,

Ramkumar .P

TOPICS
Scripting
3.7K
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

correct answers 1 Correct answer

Contributor , Feb 26, 2010 Feb 26, 2010

Thanks to all who replied.


I got the answer by "CreatorToo>Adobe InDesign [3/4/5]".


Regards,

Ramkumar .P

Translate
Community Expert ,
Feb 25, 2010 Feb 25, 2010

app.version gives the Indesign version, wich is two notches up from the CS version.

switch (parseInt (app.version))

   {

   caseof 4: $.writeln "CS3"; break;

   caseof 5: $.writeln "CS4"; break;

   // etc.

   }

Peter

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
Engaged ,
Feb 25, 2010 Feb 25, 2010

Hi Peter,

I think Ramkumar want to know in which application version indesign document created.

Shonky

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
Guru ,
Feb 25, 2010 Feb 25, 2010

Then this may help…

http://indesignsecrets.com/utility-opens-indd-files-in-the-correct-version-of-indesign-in-osx.php

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
LEGEND ,
Feb 25, 2010 Feb 25, 2010

Shonkyin wrote:

I think Ramkumar want to know in which application version indesign document created.

Then he need to check 30th byte of INDD file.

2 - ID 2.0.2

3 - CS1

4 - CS2

5 - CS3

6 - CS4

robin

www.adobescripts.com

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
LEGEND ,
Feb 25, 2010 Feb 25, 2010

Are you sure it's always the 30th byte?

You can also search the file for:

/<x(a|m)p:CreatorTool>Adobe InDesign \d/

And the digit at the end will be the version number...

Harbs

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
LEGEND ,
Feb 25, 2010 Feb 25, 2010

Harbs. wrote:

Are you sure it's always the 30th byte?

Yes, I'm sure

I'm using this method in my scripts and I've checked this  in HEX editor before replying.

CSversions.gif

robin

www.adobescripts.com

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
LEGEND ,
Feb 25, 2010 Feb 25, 2010

Okay. Good to know...

How did you figure this out?

Harbs

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
LEGEND ,
Feb 25, 2010 Feb 25, 2010

Harbs. wrote:

Okay. Good to know...

How did you figure this out?

I don't remember

This could be my idea or this could be mentioned on this forum.

I can't verify it now - but if I good remember - the same way you can check CorelDRAW file version

robin

www.adobescripts.co.uk

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
Engaged ,
Feb 25, 2010 Feb 25, 2010

I found below code on Adobe forum.

f = File.openDialog ('Select file', undefined, false);

alert('Indesign version: '+getFileVersion(f));

function getFileVersion(f){

var IDVersion;

f.open('r')

f.seek(29, 0)

IDversion = f.readch().charCodeAt(0);

f.close();

return (IDversion);

}

I have tested on few files and its work.
Shonky

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 ,
Feb 25, 2010 Feb 25, 2010

---

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 ,
Feb 25, 2010 Feb 25, 2010

Hi Robert,

I don't think that is correct. It depends what platform the file was created on - Mac or PC. InDesign files are subject to the endianness of the creating platform.

On PC, data is stored in L...H format, on Mac it is stored in H...L format. So if the file originated on a PC, you'd look for four consecutive bytes 05 00 00 00 and for a file that came from a the Mac, the file would contain 00 00 00 05 in those same four bytes.

Try to get hold of a file created on a Mac, and see for yourself...

Cheers,

Kris

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
LEGEND ,
Feb 25, 2010 Feb 25, 2010

Kris,

I just checked both Mac and Windows files, and did not see a difference.

The first 30 bytes in every file I checked were:

06 06 ED F5 D8 1D 46 E5 BD 31 EF E7 FE 74 B7 1D

44 4F 43 55 4D 45 4E 54 01 70 0F 00 00 06

(or 05, 04, or whatever)

???

Harbs

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 ,
Feb 26, 2010 Feb 26, 2010

Oops - correction - that needs to be a PowerPC Mac. Intel Macs have the same endianness as PCs, so they look the same. Try to get hold of a file created on a PowerPC Mac (which has Motorola endianness) - it's different, you'll see.

Cheers,

Kris

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
LEGEND ,
Feb 26, 2010 Feb 26, 2010

Ah. That makes much more sense!

Here's the first 36 bytes of a PowerPC file...

06 06 ED F5 D8 1D 46 E5 BD 31 EF E7 FE 74 B7 1D

44 4F 43 55 4D 45 4E 54 02 00 00 0F 70 00 00 00

06 00 00 00

Harbs

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
Contributor ,
Feb 26, 2010 Feb 26, 2010

Thanks to all who replied.


I got the answer by "CreatorToo>Adobe InDesign [3/4/5]".


Regards,

Ramkumar .P

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 ,
Feb 26, 2010 Feb 26, 2010

Essentially, from position 25 onwards you see two 4-byte longs - 0x00000F70 0x00000006 (or whatever the version is). On Intel-endian machines they are encoded as 70 0F 00 00 - 06 00 00 00, on PowerPC-endian machines they are encoded as 00 00 0F 70 - 00 00 00 06. Unless you're aware of the endianness, the version number will seem to 'shift' position in the file depending on the file's origin.

To do it correctly, you need to read the single byte at position 24. If that byte is a 1, the file is Intel-endian. If that byte is a 2, the file is PowerPC-endian.

Then you need to read 4 bytes from position 29 onwards. Those 4 bytes need to be interpreted depending on the endianness. The resulting 4-byte long is the version number.

Also works for other files (e.g. indb etc...).

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
LEGEND ,
Feb 26, 2010 Feb 26, 2010

Thanks for the lesson, Kris,

Endiannees was one of those things that I was always meaning to figure out, but never did...

Harbs

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 ,
Feb 26, 2010 Feb 26, 2010

Thanks, Kris -- very useful stuff.

Peter

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
Advocate ,
Feb 26, 2010 Feb 26, 2010

RorohikoKris wrote:

on PowerPC-endian machines they are encoded as 00 00 0F 70 - 00 00 00 06. Unless you're aware of the endianness, the version number will seem to 'shift' position in the file depending on the file's origin.

So how come the lists of bytes that Harbs posted for Intel/Windows and PowerPC were identical?

I thought endian-ness didn't matter with 8-bit bytes, but I was with Harbs the day it was taught...

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
LEGEND ,
Feb 26, 2010 Feb 26, 2010

They were not.

Byte 25 and on with Intel was: 01 70 0F 00 00 06 00 00 00

While PowerPC it was: 02 00 00 0F 70 00 00 00 06

Harbs

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 ,
Feb 26, 2010 Feb 26, 2010
LATEST

It's not the endianness inside single bytes (thank the Silicon Gods for that!).

  • It's when you are working with values that require more than a single byte -- i.e., everything above 255 (which is the highest value that can be expressed -- normally -- with a single byte).
  • Everyone can see that 4589 is less than 9341, even though it has the same number of digits, because, well, the first one's rightmost digit is '9' and the second one's is '1' but that doesn't make sense, because it's the leftmost digit that counts most.

    You're thinking, "Sure, but what about that endianness thingy?"

    It's the same thing. Suppose you get two 2-byte values:

    (a) 123 and 85

    (b) 86 and 100

    Which 2-byte value is the largest? Well, obviously it's the first one, as the most significant part (123) is clearly larger than that of the other (86). Now suppose you have to design a computer chip, and you have to decide in which order to store 2-byte values. It's quite obvious to you, me, and, for example, Motorola engineers, how you would do that: most significant byte first, then least significant.

    Unfortunately, the designers of the most prevalent microchip to date, Intel, decided to do it ... the other way around. (Insert appropriate smiley/sad face/horror here). For some reason, they reckoned it useful to store the least significant part first. Remember, back in "the day" when this was decided, using two bytes to store a number was ... well, how golly big numbers do you computer techies want to process!? Two bytes, that's up in the thousands! Imagine!

    So I imagine there must have been a highly technical reason for it.

    The term "endianness", by the way, comes from Gulliver's Travels -- which, I'm sure, most of you read. Remember the Civil Wars on which end to start eating an egg?

    Applying this to the (a) and (b) numbers, when you are asked "what is the bigger two-byte number?", then you ask "Is it Most Significant Byte first, or Least Significant first?" Is it the former, then it's (a); for the latter, it's (b).

  • Above-criticized engineers had no problem in deciding that in
  •   10010001

    the highest bit value (128) is always on the left, and the lowest (1) is always on the right.

    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 ,
    Feb 25, 2010 Feb 25, 2010

    Hello Shonky,

    Maybe, but he asked "I need to identify the Application Version", not "I need to identify which application version created document x". But we'll see what he says...

    Peter

    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