Skip navigation
Currently Being Moderated

[Ann] Identify Your InDesign File

Dec 8, 2011 5:54 AM

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.

 
Replies
  • Currently Being Moderated
    Dec 8, 2011 8:01 AM   in reply to [Jongware]

    Thanks Jongware - that looks good. Not sure what I'll use it for.

     

    Where did the need for this come from though?

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 8, 2011 8:17 AM   in reply to [Jongware]

    [Jongware] wrote:

     

    Things I won't

    "Upgrade" it to actually open the newer files in your old CS3.

    Aw. c'mon. What fun is that? <big wink>

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 9, 2011 6:26 AM   in reply to [Jongware]

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 7, 2012 2:19 PM   in reply to [Jongware]

    I tested this in CS3 and it appears to work. Magic!

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2012 4:37 PM   in reply to [Jongware]

    sorry where can i locate the User scripts folder in 10.6.8?

     

    and how should i launch the script?

     

    sorry, i am script newbie!

     

    thanks

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 17, 2012 9:16 AM   in reply to [Jongware]

    Nifty script and works in 10.3.7 as well as CS5.

     

    Another useful Jongware script*

     

    * This is not a paid endorsement.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 7, 2012 8:26 AM   in reply to [Jongware]

    So I can open a CS5.5—with Soxy— and it will then script it and save as CS5.5 rather than auto open the IDD as CS 6? More clarification please.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 7, 2012 8:31 AM   in reply to katx11

    All the script does is tell you what version of InDesign the selected file was saved in. It doesn't open it, save it, or do any other modifications.

     
    |
    Mark as:
  • lilia@
    196 posts
    Jan 31, 2012
    Currently Being Moderated
    Jun 7, 2012 2:25 PM   in reply to [Jongware]

    [Jongware] wrote:

     

    Kat clearly didn't read the "Things it Does Not" section

    ...like it... i like the "Things I won't" section even more hahahaha...clearly a need to be told!

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 6, 2012 7:40 PM   in reply to [Jongware]

    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);
        }
      }
    }
     
    
     
    |
    Mark as: