Skip to main content
Participant
October 23, 2008
Question

InDesign CS3 Mac vs PC?

  • October 23, 2008
  • 5 replies
  • 673 views
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
This topic has been closed for replies.

5 replies

Peter Kahrel
Community Expert
Community Expert
November 11, 2008
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)
Inspiring
November 10, 2008
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
Known Participant
November 10, 2008
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
Participant
November 10, 2008
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?
Known Participant
October 23, 2008
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