4 Replies Latest reply on Oct 21, 2010 5:20 AM by Wozorito

    Differences between COM & JavaScript Scripting

    Wozorito

      Hi all,

       

      I have to make a sort of script that populate an InDesign document with some data from a database.

       

      I can do it with a Web Service called in Javascript or in C# with COM.

       

      Do you know the differences between COM and Javascript scripting ?

       

      What is the best ?

       

      Thank you.

        • 1. Re: Differences between COM & JavaScript Scripting
          Harbs. Level 6

          InDesign officially supports Javascript and VB.

           

          It does not officially support COM. InDesign scripting is weakly typed by design.

           

          If  you can do it with Javascript, that's the recommended way...

           

          Harbs

          1 person found this helpful
          • 2. Re: Differences between COM & JavaScript Scripting
            Wozorito Level 1

            Hello,

            Would javascript be the recommanded way to go if i want to interop with it without any user interaction?

            Out goal is to produce catalogues (from another application , in C# / .net 4.0) which already contains the data. We want to be able to push that data toward indesign so direct com interop seemed to make the most sense.

            Is there a way to send javascript commands to indesign from another program (NOT to indesign server and it's web services, we want to do this directly on the locally installed indesign client)?

            Also what would be the proper way to send non textual data in indesign? (images etc) from a C# app as those can't simply be serialized as json and passed as text as part of the JS commands.

            Doing this in javascript is fine for us too as long as there is a way to pass said javascript from an external app. Or should we look completely elsewhere?

            Any means of commanding Indesign CS 5 from .net 4 would be great.

            Best regards.

            • 3. Re: Differences between COM & JavaScript Scripting
              Harbs. Level 6

              If you are looking for inter-app communication, you are best off using VB Script to run the script.

               

              If you'd like to use javascript, you can run it in VB using a doScript command, or if you are comfortable in VB, you can just do the whole thing in VB.

               

              Either method would work.

               

              Harbs

              • 4. Re: Differences between COM & JavaScript Scripting
                Wozorito Level 1

                I guess we could do it all in JavaScript and run it throught VB but how could we pass data? I can pass the JS

                from the C# application but what about images & such that aren't serializeable to json?