3 Replies Latest reply on Jun 10, 2008 12:47 PM by (Olav_Kvern)

    Javascript - Create a File in InDesign

      Hello,

      i would like to create an empty document in indesign from javascript without the extendscript toolkit only by double clicking the .jsx file. I think i have to include the right COM object model.
      How should i do this.

      Thank you!
        • 1. Re: Javascript - Create a File in InDesign
          Level 1
          Hi Cube,

          You can't do this using ExtendScript (the Adobe "flavor" of JavaScript--it doesn't know anything about COM. You can use JScript (the Microsoft flavor of JavaScript), but, if you do, you'll need to use the VBScript version of the InDesign object model.

          You could also create a VBScript that runs a specified (ExtendScript) JavaScript when you double-click the .vbs file. It would look like this:

          Set myInDesign = CreateObject("InDesign.Application.CS3")
          Rem You'll have to fill in a valid file path to your JavaScript.
          Rem Note: 1246973031 = idScriptLanguage.idJavaScript
          myInDesign.DoScript("c:\myJavaScript.jsx", 1246973031)

          Thanks,

          Ole
          • 2. Re: Javascript - Create a File in InDesign
            Level 1
            OK, thanks!

            So is there any chance to do this in C#...maby in Java, too??
            • 3. Re: Javascript - Create a File in InDesign
              Level 1
              Hi Cube,

              Look through the forum for notes about doing this in C#. I'm sure you can do it using Java, as well (I just haven't ever done that, so I don't know how, but it can't be too hard).

              Note, however, that the supported languages are JavaScript, AppleScript, and VBScript, and that the farther you go from these languages, the more trouble you'll have.

              Thanks,

              Ole