5 Replies Latest reply on Nov 10, 2008 4:09 PM by Peter Kahrel

    InDesign CS3 Mac vs PC?

      Is there a way to tell if an InDesign CS3 file is Mac or PC in applescript or even by opening the file as text? I am having a hard time figuring out how to tell if an InDesign CS3 file was created on a Mac or on a PC. Any help would be great. Thanks
        • 1. Re: InDesign CS3 Mac vs PC?
          Level 1
          Hi Don,

          Why would you need to know?

          If you're using AppleScript, it's most likely that the file type/file creator will not have been set on files created in Windows that have never been opened on the Mac OS.

          Thanks,

          Ole
          • 2. Re: InDesign CS3 Mac vs PC?
            Level 1
            Thanks Ole. Sometimes it is the simplest things that are staring you in the face. Can you help me with one other that I've been having trouble with? How do you tell which version of InDesign a file was created with on a PC?
            • 3. Re: InDesign CS3 Mac vs PC?
              Level 1
              Hi Don,

              Hm. That one is harder. I guess my first thought is: you can't. But my second thought is that if it opens as "Untitled," at least you know it wasn't created in the current version. Hope that helps?

              Thanks,

              Ole
              • 4. Re: InDesign CS3 Mac vs PC?
                Jim Birkenseer Level 1
                Don,

                I believe an InDesign Template file (.indt) will be opened as "Untitled-#". I think that opening an older file will have "[Converted]" in the document window's title, but the document name will remain the same as the original.

                You can find the version of InDesign that created the document by using the metadata preferences property of the document. The "creator" property is the version of InDesign that last saved the document.

                At any rate, I think this the following code may get you on the road to doing what you want:

                tell application "Adobe InDesign CS3"

                    

                    -- Assume an opened document

                    set myDoc to document 1

                    

                    -- Check to see if myWindowTitle contains "[Converted]". If it

                    --    does contain "[Converted]", myDoc was probably created in a

                    --    version of InDesign previous to the version that is running.

                    --    If the user saves the document with "[Converted]" in

                    --    its name, you will need to look for "[Converted]" in

                    --    the window title after the @ and % sign in the window title

                    --    or by using some other clever means of detection.

                    set myWindowTitle to (name of window 1 of myDoc as text)

                    display dialog myWindowTitle

                    

                    -- Get the creator version of the document.

                    set myCreatorVersion to (creator of metadata preferences of myDoc as text)

                    display dialog myCreatorVersion

                    

                end tell


                -- Jim
                • 5. Re: InDesign CS3 Mac vs PC?
                  Peter Kahrel Adobe Community Professional & MVP
                  InDesign writes its version at byte 30 in a document, so reading that gives you the document's creator. That way you can check a document's creator before opening it:

                  doc = '/d/test/test.indd'
                  
                  alert (doc + ' was created by InDesign ' + creator ( File (doc)));

                  function creator (f)
                     {
                     if (f.exists)
                        {
                        f.open ('r', undefined, undefined);
                        f.encoding = 'binary';
                        f.seek (29, 0);
                        var version = f.readch ();
                        f.close();
                        return version.charCodeAt ()
                        }
                     }


                  Peter (thanks to Teus)