A CS4 & upwards compatible script -- if anyone dares to try it out in a lower version, please do so. It pops up a standard file dialog where you can select any file, and the script will dive into it and see what version of InDesign it was last saved with.
Download the zip from my website: identify.zip -- unpack, and put "IDentify.jsx" to the folder where you put all of your User scripts.
Things it does
It shows the file name, file type (as stored in the file), and version of InDesign files from InDesign version CS up to CS5.5 (tested). It does not work for ID 1.0, 1.5, 2.0. It may not work for versions after CS5.5.
Things it doesn't
It does not open the newer files in your old CS3.
It does not identify IDML files (nor anything else, by the way, than InDesign files).
It does not Fix Your Broken Files.
Written using CS4, so it may or may not work on older or newer versions.
Things I won't
"Upgrade" it to actually open the newer files in your old CS3.
Explain how it works.
Unobfuscate to make it clear how it works.
Respond to Private Mail inquiries of how it works.
Eugene Tyson wrote:
Thanks Jongware - that looks good. Not sure what I'll use it for.
You must be working exclusively with the Very Latest Version.
This is a tool for people who ask "why can't I open this file in my version of InDesign"; at least we can now unambiguously answer "because this file you got is newer, never mind what your client said."
(Or we could but we don't have to because now people can find out for themselves.)
this will certainly have a use in my office where i'm on CS3; a colleague has CS4; another colleague has CS5; and soon a different colleague will have 5.5. now when i receive a file i can't open (with no PDF supplied either) i'll know who i have to kick off of which machine!
assuming it works in CS3... haven't tested that yet ![]()
10.6.8 must be your OS version, because InDesign is not there yet. Neither is Windows, so (guessing again) you must be using Mac OS X? If you don't get a pop-up menu when you right-click your User scripts in the Scripting panel there may be something wrong with your computer or with InDesign (or possibly the right button on your mouse).
Did you try the online help? It should direct you here: http://help.adobe.com/en_US/indesign/cs/using/WS0836C26E-79F9-4c8f-815 0-C36260164A87a.html
You could also read http://indesignsecrets.com/how-to-install-scripts-in-indesign.php
Thanks Jongware. That was super helpful!
Here is how to do the same kind of thing in C#:
using System;
using System.Linq;
using System.IO;
namespace InDesignWrapper {
class VersionChecker {
private byte[] InDesignFileHeader = new byte[] { 0x06, 0x06, 0xED, 0xF5, 0xD8, 0x1D, 0x46, 0xe5, 0xBD, 0x31, 0xEF, 0xE7, 0xFE, 0x74, 0xB7, 0x1D };
private int byteOrderFlag;
public string GetInddFileVersion(string filename) {
var fileinfo = new FileInfo(filename);
var stream = fileinfo.OpenRead();
var reader = new BinaryReader(stream);
var fileHeader = reader.ReadBytes(16);
if (!fileHeader.SequenceEqual(InDesignFileHeader))
return "Not an InDesign file";
string fileType = new String(reader.ReadChars(8));
byteOrderFlag = reader.ReadByte();
reader.ReadBytes(4);
var majorVersion = reader.ReadInt32(byteOrderFlag) - 2;
var minorVersion = reader.ReadInt32(byteOrderFlag);
return String.Format("CS {0}.{1}", majorVersion, minorVersion);
}
}
static class BinaryReaderExtensionMethods {
public static byte[] ReadOrderedBytes(this BinaryReader reader, int count, int byteOrderFlag) {
if (byteOrderFlag == 2) return reader.ReadBytes(count).Reverse().ToArray();
return reader.ReadBytes(count);
}
public static long ReadInt32(this BinaryReader reader, int byteOrderFlag) {
return BitConverter.ToInt32(reader.ReadOrderedBytes(4, byteOrderFlag), 0);
}
}
}
North America
Europe, Middle East and Africa
Asia Pacific