5 Replies Latest reply on Mar 28, 2011 1:52 PM by [Jongware]

    c# Hello World



      I'm new to scripting with InDesign, and I already have experience coding in c#, and I understood that I can use c# with InDesign, but I can't find a site to help me get started.


      Can anyone make any recommendations/suggestions?




        • 1. Re: c# Hello World
          [Jongware] Most Valuable Participant

          Is there a specific reason you want to script in C#?


          I'm asking this because InDesign supports three langauges right away (well, only two out of three per OS): Javascript, Applescript, and Visual Basic. All other languages are only supported through generic COM objects, which isn't really the best way to interact with ID -- a lot of its objects are chameleonistic (the actual scientific term eludes me for the mo' ).


          If you only asked about C# support because you already know that language, can I convince you towards looking into Javascript? (It's a language of its own and there are some pretty major differences with C, C++, and C#, but you are not likely to run into these right away.)

          • 2. Re: c# Hello World
            wunderfamily@gmail.com Level 1

            Well one reason is being familiar with c# is one reason, the other one is the lack of reasonable IDE to work with. I'm not afraid of trying a new language, but not having a good IDE can be a really big pain. Is there a reasonable IDE to work with?



            • 3. Re: c# Hello World
              [Jongware] Most Valuable Participant

              It depends on how reasonable the Extendscript Toolkit Editor works for you as an IDE ... It's the recommended editor for Javascript, because you can run and debug your InDesign scripts from it. It also features an integrated Object Model Viewer, to use as a Quick Command Reference. The ESTK comes installed for free with your InDesign.


              .. However, personally I can't stand the freakin' thing! So I make do without debugging (which, at times, becomes visible in my scripting) and use plain text editors -- my editors of choice are Textpad (Windows) and TextWrangler.


              It does mean I cannot use the built-in Help, so I made my own version (using Adobe's data, of course): http://www.jongware.com/idjshelp.html

              • 4. Re: c# Hello World
                Harbs. Level 6

                I agree with Jongware.


                I find I code fastest in BBEdit. I only go to the ESTK if I need to step through a script. This is not usually the case.


                For simple debugging, I just put in some alerts to give me an indication of what's going on...



                • 5. Re: c# Hello World
                  [Jongware] Most Valuable Participant

                  Polymorphic. Yeah, def'n'tly, that was it: they are polymorphic.