29 Replies Latest reply on Mar 30, 2017 11:55 AM by oleh.melnyk

    [Ann] Identify Your InDesign File

    [Jongware] Most Valuable Participant

      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.

        • 1. Re: [Ann] Identify Your InDesign File
          Eugene Tyson Adobe Community Professional & MVP

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

           

          Where did the need for this come from though?

          • 2. Re: [Ann] Identify Your InDesign File
            Peter Spier Most Valuable Participant (Moderator)

            [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>

            • 3. Re: [Ann] Identify Your InDesign File
              [Jongware] Most Valuable Participant

              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.)

              • 4. Re: [Ann] Identify Your InDesign File
                Colin Flashman Level 4

                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

                • 5. Re: [Ann] Identify Your InDesign File
                  davidblatner Adobe Community Professional

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

                  • 6. Re: [Ann] Identify Your InDesign File
                    dumpav Level 1

                    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

                    • 7. Re: [Ann] Identify Your InDesign File
                      [Jongware] Most Valuable Participant

                      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-8150-C36260164A87a.html

                       

                      You could also read http://indesignsecrets.com/how-to-install-scripts-in-indesign.php

                      • 8. Re: [Ann] Identify Your InDesign File
                        Mr. Met Level 3

                        Nifty script and works in 10.3.7 as well as CS5.

                         

                        Another useful Jongware script*

                         

                        * This is not a paid endorsement.

                        • 9. Re: [Ann] Identify Your InDesign File
                          katx11 Level 1

                          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.

                          • 10. Re: [Ann] Identify Your InDesign File
                            Peter Spier Most Valuable Participant (Moderator)

                            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.

                            • 11. Re: [Ann] Identify Your InDesign File
                              [Jongware] Most Valuable Participant

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

                              • 12. Re: [Ann] Identify Your InDesign File
                                lilia@ Level 2

                                [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!

                                • 13. Re: [Ann] Identify Your InDesign File
                                  Tony722 Level 1

                                  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);
                                      }
                                    }
                                  }
                                  
                                  
                                  • 14. Re: [Ann] Identify Your InDesign File
                                    AnneMarie Concepcion Adobe Community Professional

                                    Jongware this is cool, but wondering if you could update it to show CC, CC 2014, and CC 2015?  (It reports things like "CC.next.next" and "CC.2" instead.)

                                     

                                    thanks!

                                    AM

                                    • 15. Re: [Ann] Identify Your InDesign File
                                      [Jongware] Most Valuable Participant

                                      AnneMarie, the shift from InDesign 1.0 and InDesign 2.0 to InDesign CS (which is "3") was already quite confusing (and in my opinion totally unnecessary) but at least Adobe managed to stick to this numbering scheme for ... wait for it: 6 versions!

                                       

                                      Alas: since InDesign CC the numbering has become totally unclear to me. The version number (which is what I read out of the document) can no longer be translated linearly into the name "CC", "CC 2014" or "CC 2015" – I don't know any longer what number should correspond to what name, and, possibly worse, I also cannot predict what the next version will be named. ("2016"? "CC 10"? "CD"?)

                                       

                                      It's just one of the cases where marketing decisions defeat common human (and computer) logic.

                                      • 16. Re: [Ann] Identify Your InDesign File
                                        davidblatner Adobe Community Professional

                                        While I agree that Adobe's naming is very confusing, I believe there is some logic to it. If you choose About InDesign from the InDesign menu (mac) or Help menu (Windows), you'll see that CC 2015 is version 11. CC 2014 was version 10. CC (which I call CC 2013) was version 9. Adobe seems to be releasing 2 additional versions per year, in October (a .1 sub-version) and then around February or March (a .2 sub-version).

                                         

                                        So version 10.2 could be called "CC 2014.2"... yes?

                                        • 17. Re: [Ann] Identify Your InDesign File
                                          BobLevine MVP & Adobe Community Professional

                                          Whoa! Zombie thread walking the earth again.

                                           

                                           

                                           

                                          Seriously, though, I agree the whole naming thing is confusing to the average users. I wish I had a dime for every post that I had to respond to asking what version someone was using.

                                          • 18. Re: [Ann] Identify Your InDesign File
                                            [Jongware] Most Valuable Participant

                                            David, the problem is the main version numbering: if version 10 is "CC 2014" then the Secret Code is 'version + 2004'; and so version 11 should be "CC 2015". Likewise, a next major version would then logically be called "CC 2016". But at some point Adobe is going to release two major versions in the same year (unlikely, but stranger things have happened) or they are going to skip a year, and from that point on this system will no longer work.

                                             

                                            Jumps like Windows' numbering, from 3.1 to "95", "98", "2000", "ME", "XP", "Vista", "7", "8" and now "10" have always been equally confusing. The last jump, skipping "9", is actually because of a technical reason! Microsoft cheated earlier on with the detection of the "9x" variants by only checking the first decimal, and if it was a '9' it reported back '7'.

                                             

                                            (That said: I updated the script for the last two versions of ID. Will upload it to my site later.)

                                            • 19. Re: [Ann] Identify Your InDesign File
                                              Sandee Cohen Adobe Community Professional

                                              David,

                                              There's actually a simpler problem.

                                               

                                              Go to the Adobe website and find a listing for InDesign. All it will stay is InDesign CC.

                                               

                                              Yes I know there are all sorts of things that say 2015 is here. But if I was downloading the software I would have no idea what version I I was about to use.

                                               

                                              Go to this page. There is no mention of 2015. You're just lost.

                                               

                                              https://www.adobe.com/downloads.html

                                               

                                              And not only that but the icons are identical for 2014 and 2015. Hence people pasting new desktop icons.

                                               

                                              I also believe that naming with the year is confusing. We spent 5 months of 2015 working with 2014 software. It makes the product look old.

                                               

                                              I'm not saying Adobe should name things CC Beagle, CC Poodle, or some other silly convention. But CC Gold. CC Silver. CC platinum. CC Titanium. Etc wouldn't be so bad and would actually help brand awareness.

                                               

                                               

                                              Sent from my iPhone

                                              So pardon the brevi

                                              • 20. Re: [Ann] Identify Your InDesign File
                                                ElishevaH Level 1

                                                Jongware, I don't understand how to use your "identify" file to find out information about my InDesign file. How do I do this?

                                                Thank you.

                                                • 22. Re: [Ann] Identify Your InDesign File
                                                  ElishevaH Level 1

                                                  I installed it and I get the message "this file is not executable by any supported script language".

                                                  What does this mean?

                                                  • 23. Re: [Ann] Identify Your InDesign File
                                                    Peter Spier Most Valuable Participant (Moderator)

                                                    Did you unzip the file first?

                                                    • 24. Re: [Ann] Identify Your InDesign File
                                                      ElishevaH Level 1

                                                      Okay, so I unzipped the file and now I don't get that message. Now how does this script help me get the information about the InDesign file that doesn't open?

                                                      • 25. Re: [Ann] Identify Your InDesign File
                                                        Peter Spier Most Valuable Participant (Moderator)

                                                        Double-click the script name in the Scripts panel.

                                                        • 26. Re: [Ann] Identify Your InDesign File
                                                          ElishevaH Level 1

                                                          Got it! It works! Great, thanks so much.

                                                          • 27. Re: [Ann] Identify Your InDesign File
                                                            tanekab36338788 Level 1

                                                            I really need help. I am using the newest version of Indesign and I saved it as Idml but it won't open. It says it may not support it or there may be a missing plugin. Tried from another computer but it still won't open.

                                                            • 28. Re: [Ann] Identify Your InDesign File
                                                              Peter Spier Most Valuable Participant (Moderator)

                                                              How did you save the file as IDML? That particular error generally means there is a lock file present, or the file you are trying to open isn't a format readable by InDesign.

                                                              • 29. Re: [Ann] Identify Your InDesign File
                                                                oleh.melnyk Level 2

                                                                I made some modifications, so now it seems to show correct CC version, like CC 2015 or CC 2017 + some minor code formatting

                                                                 

                                                                //DESCRIPTION:Test InDesign file for version
                                                                // A Jongware Script 27-Jun-2013
                                                                
                                                                
                                                                /*
                                                                    Modified 30 March 2017 
                                                                        By: Oleh Melnyk 
                                                                        Reason: to show actual CC version, for example "CC 2014" or "CC 2017" instead of "CC.next" or "CC.next.next.next"; + some general code formatting
                                                                */
                                                                
                                                                
                                                                #target: indesign;
                                                                
                                                                
                                                                var scriptName = "Test InDesign file for version"; // A Jongware Script
                                                                var scriptVersion = " (30 March 2017)"; // start with a space
                                                                
                                                                
                                                                var iddFile = File.openDialog("Select an InDesign file", "InDesign file:*.indd;*.indt", true);
                                                                
                                                                
                                                                if (iddFile == null) exit(0);
                                                                
                                                                
                                                                var f = File(iddFile);
                                                                var filename = f.displayName;
                                                                
                                                                
                                                                if (f.open("r") == false){
                                                                    alert ("Unable to open this file!", "Error", 1); 
                                                                    exit();
                                                                } else {
                                                                    f.encoding = "binary";
                                                                
                                                                
                                                                    var g = f.read (16); 
                                                                    var h = f.read(8);
                                                                    var j = f.read(1).charCodeAt(0);
                                                                    var k = f.read(4);
                                                                    var l = gl (f, j); 
                                                                    var l_m = gl (f, j);
                                                                    var m = f.length; 
                                                                    f.seek (280); 
                                                                    var i = gl (f, 0)*4096;
                                                                    f.close();
                                                                
                                                                
                                                                    if (g != "\x06\x06\xED\xF5\xD8\x1D\x46\xe5\xBD\x31\xEF\xE7\xFE\x74\xB7\x1D"){
                                                                        alert ("This is not a valid InDesign document"); 
                                                                        exit();
                                                                    } else {
                                                                        if (l >= 3) {
                                                                            if (l == 3) l2 = "CS";
                                                                            else if (l > 8) {
                                                                                //l2 = "CC";            
                                                                                //while (l-- > 9) l2 += '.next';
                                                                                var version = 0;
                                                                                var CCversions = ["CC", "CC 2014", "CC 2015", "CC 2017", /*Just a prediction for future versions > */"CC 2018", "CC 2019", "CC 2020"]; // <- add new versions here; and yes, "CC 2016" was skipped by Adobe
                                                                                
                                                                                while (l-- > 9) version++;
                                                                                
                                                                                l2 = CCversions[version];
                                                                            } else l2 = "CS"+(l-2); 
                                                                        }
                                                                        if (l_m != 0) l2 = l2+"."+l_m;
                                                                
                                                                
                                                                        if (m < i){
                                                                            alert ("File: "+filename+"\r"+
                                                                                    "Reported type: "+h+"\r"+
                                                                                    "Reported version: "+l2+"\r\r"+
                                                                                    "Length of this file is less than expected — it may be damaged!", scriptName+scriptVersion, 1);
                                                                        } else {
                                                                            if (parseFloat(app.version) < l) {            
                                                                                if (parseFloat(app.version) < 4) {
                                                                                alert ('You cannot open "'+filename+'" because it was saved with a newer version of Adobe InDesign ('+l2+').\r'+
                                                                                    'You must use that version or later to open the file. To then enable it to be opened in this version, export to IDML, then use InDesign CS4 to export to INX.', scriptName+scriptVersion, 1);
                                                                                } else {
                                                                                    alert ('You cannot open "'+filename+'" because it was saved with a newer version of Adobe InDesign ('+l2+').\r'+
                                                                                        'You must use that version or later to open the file. To then enable it to be opened in this version, export to IDML.', scriptName+scriptVersion, 1);
                                                                                }
                                                                            } else {
                                                                                alert ('You can open "'+filename+'" with this InDesign version.\rIt has been saved as Adobe InDesign ('+l2+').', scriptName+scriptVersion);
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                                
                                                                
                                                                function gl (a,b) {
                                                                var c = a.read(4);
                                                                if (b == 2) return (c.charCodeAt(3)) + (c.charCodeAt(2) << 8) + (c.charCodeAt(1) << 16) + (c.charCodeAt(0) << 24);
                                                                return (c.charCodeAt(0)) + (c.charCodeAt(1) << 8) + (c.charCodeAt(2) << 16) + (c.charCodeAt(3) << 24);
                                                                }
                                                                

                                                                 

                                                                Lines 57-62 responds for showing correct CC version

                                                                1 person found this helpful