15 Replies Latest reply on Apr 11, 2010 2:35 AM by Jeremy bowmangraphics

    [JS] Using Eclipse to build and debug

    Roy Marshall Level 1

      Hi.

       

      Is it possible to use the eclipse environment to write (I know I can do this) and debug javascripts for InDesign?

       

      I am asking this as I work for a company who use Eclipse to build the Web software we provide, and we want to be able to use one common dev platform for the Java code, and my Javascripts.

       

      Cheers

       

      Roy

        • 1. Re: [JS] Using Eclipse to build and debug
          S.Biancardo Level 1

          You Can use ExtendScript ToolKit for this.

          • 2. Re: [JS] Using Eclipse to build and debug
            grefel Level 2

            Here you can find any information you need:

             

            http://labs.adobe.com/wiki/index.php/PatchPanel

             

            it installed and tested patchpanel with indesign around one year ago. very buggy... escpecially debugging was no fun at all (restarting eclipse & indesign all the time).

            i think this was just an experimet  (adobe labs) and no further development was made.

             

            if you make better experiences it would be nice to read about it

             

            regards,

            gregor

            • 3. Re: [JS] Using Eclipse to build and debug
              [Jongware] Most Valuable Participant

              Want to hear a list of things that are cumbersome, irritating, infuriorating, or simply wrong about the ESTK editor?

               

              I use TextPad. It even integrates nicely with my own CHM version of the Help: one key press and I have context-aware help on whatever command the cursor is pointing to.

              • 4. Re: [JS] Using Eclipse to build and debug
                grefel Level 2

                i do not like the estk either, but how do you debug?

                 

                breakpoints, step by step, data browser ... all things a cannot miss...

                 

                i personally dislike only the missing context sensitive code completion feature. but maybe cs5 :-)

                • 5. Re: [JS] Using Eclipse to build and debug
                  [Jongware] Most Valuable Participant
                  i do not like the estk either, but how do you debug?

                   

                  You mean, while a script is running? I don't. I write scripts one line at a time, putting in alerts wherever I think it may go wrong. Occasionally I put an alert inside a loop that's going to be called ten thousand times -- that's when I think, "well perhaps I'd better try this from the ESTK".

                   

                  I never got to 'run a command from the console', I only have a vague idea of what should happen.

                  • 6. Re: [JS] Using Eclipse to build and debug
                    Fred Goldman Level 3

                    I'm interested in hearing all the gripes against the ESTK. My main gripe is constant crashing, so I have made it a habit to constantly save things. It's still much better than the alternative IMHO...

                    • 7. Re: [JS] Using Eclipse to build and debug
                      [Jongware] Most Valuable Participant

                      On my Mac at home it frequently stops saving (although it says it did, leaving me to wonder why the **** my script doesn't work) and then crashes when I try to quit -- silently deleting all changes I made to the script, because it never saved them in the first place.

                       

                      But my main problem is with the intrusive user interface -- the non-standard Search & Replace box annoys me, the Help system is not very intuitive, and the auto-complete is a complete disaster, as it only and exclusively pops up when you don't want it to and its suggestions are, frankly, worthless.

                       

                      (Ahhh ... I feel so much better now.)

                      • 8. Re: [JS] Using Eclipse to build and debug
                        Fred Goldman Level 3

                        Ouch, not saving is bad!

                         

                        I use Teus de Jong's little object browser, it's great. The built-in help is useless. (I can't stand that interface, what is it Flex?)

                         

                        Auto-Complete is also useless, but I am used to not having it.

                         

                        The search-replace is one thing I actually like. The fact that it's a panel makes it dockable so it can be open at all times while not getting in your way.

                         

                        So how do you debug? Do you type in TextPad and then copy/paste to ESTK to debug? Does it give some knid of better help and auto-complete?

                        • 9. Re: [JS] Using Eclipse to build and debug
                          cotcodac

                          Ouch... No color coding in text pad? or I have to enable some options.... I use notepad++. I also dont feel the need for debugging... Maybe I'm not that far into scripting...

                          And I use Jongware's chm file for the object model. Only if that could came with samples for everything in it.... Anyway it's such a shame that an indian guy made a vbs editor with intelisense and adobe did hear about this tehnology... I really hope that ID CS 5 come with a big improvement on this part.

                          • 10. Re: [JS] Using Eclipse to build and debug
                            [Jongware] Most Valuable Participant

                            TextPad's integration of external help files is extremely well done: you supply a list of CHM files (Compiled Windows HTML) and a hot key, and it feeds the 'current' word into the help file for looking up.

                             

                            Auto-completion, for Javascript? Nah. When I programmed for Windows, I couldn't live without it (twenty-letter-commands not being an exception), but for JS it's overkill. I might have reconsidered if it was as smart as that of the Visual Basic editor -- enter the name of a known typed variable, add a period, and you get a list of its properties and commands -- but it isn't.

                            And its implementation is ... b-a-d. What was the idea, with that popup that eats your key presses!?

                             

                            As for debugging -- I don't do that, putting breakpoints and such into programs to inspect suspicious variable values. Usually I only need a few alerts on strategic points to show me how things are running.

                             

                            ---

                             

                            † Malcolm McLaren (22 January 1946 – 8 April 2010) ...

                            • 11. Re: [JS] Using Eclipse to build and debug
                              [Jongware] Most Valuable Participant

                              Color coding for TextPad is optional and depend on the file extension. I can't recall if the definitions for Javascript comes bundled with it; if not, check their web site, as they have loads and loads of downloadable "syntax definitions". As these are simple ASCII files, you can even edit them to add ID specific stuff.

                               

                              And you have to remember that by default Javascript files have a .js extension -- you might have to add .jsx manually. But that's a piece of cake, really.

                               

                              And I use Jongware's chm file for the object model. Only if that could came with samples for everything in it....

                               

                              Heh heh heh. No it doesn't, but that's because it's the same help file as in the ESTK. For snippets, I usually check Adobe's own JS Starters guide first.

                               

                              ---

                               

                              † Malcolm McLaren (22 January 1946 – 8 April 2010) ...

                              • 12. Re: [JS] Using Eclipse to build and debug
                                John Hawkinson Level 5

                                Wow, Jongware, you don't use breakpoints? I have to say, I find breakpoints to be invaluable in debugging JSX. The ability to stop anywhere in a script (especially an error condition) and interrogate the current value of variables or expressions in the Javascript Console? That's wonderful!

                                 

                                For me, the ESTK has been pretty stable. My biggest gripe is that sometimes it seems to get confused about modifiers and I hit, e.g., Cmd-S to save, and an 's' appears in my document.

                                 

                                Of course, for easy quick changes I may make them in vi or emacs (the latter has better svn integration), but I've never been a fan of IDEs, so I can get by without just fine.

                                 

                                We're mostly on CS3 here, so I use the ESTK2. Is the CS4 version more unstable? How does it crash? What are the tracebacks? What does Adobe say?

                                 

                                And here's the big question: which do you hate more? ESTK or Jive?

                                • 13. Re: [JS] Using Eclipse to build and debug
                                  Fred Goldman Level 3

                                  ESTK2 was excellent.I never had any problems with it. CS4 is the one that I have found to be troublesome.

                                  • 14. Re: [JS] Using Eclipse to build and debug
                                    Harbs. Level 6

                                    Yes. ESTK CS4 was particularly unstable.

                                     

                                    I work mostly in BBEdit. I very rarely use ESTK CS4.

                                     

                                    Fortunately, you can expect major ESTK improvements in CS5...

                                     

                                    Harbs

                                    • 15. Re: [JS] Using Eclipse to build and debug
                                      Jeremy bowmangraphics Level 2

                                      Jongware, by a "non-standard Search & Replace box", do you mean one whose contents you can only see the top half of, like this?

                                       

                                      Screen shot 2010-04-11 at 10.22.08.png

                                       

                                      Instead of your standard "Object Model Viewer", I recommend my own "Object Model Object Model Object Model Object Model Viewer" -- it's the Object Model Viewer on steroids!

                                       

                                      Screen shot 2010-04-11 at 10.20.59.png