2 Replies Latest reply on Oct 5, 2011 6:26 AM by chud1983

    automatically debugging when calling a script from a menu item


      Hi All,


      I'm coming accross an issue that I was wondering if anyone can help me with or point me in the correct direction.


      I have two start up scripts.

      One runs in the "session" target engine and setups ups some custom menu items and actions which call some other custom scripts.

      The other runs in my own custom session and is used to initialize and share common constants and functions between my custom scripts.


      This all appears to run as expected and clicking on the new menu item calls the correct script however even without the ExtendedScript Toolkit running as soon as i click on the menu item it will load up the ESTK and break on the first line of the script. If I press F5 to continue processing it will finish and runs fine.


      I am currently using the excellent extendables package (http://extendables.org/) to do some HTTP and simplify UI creation which does not specify a session.


      Does anyone know what is causing the scripts to be automatically debugged or is there a setting that might be set to cause this?


      Is this being caused by "session" calling "customSession" using code that will run in the default "main" session?


      this really is irritating me at the moment so if anyone can help it would be much appreciated.


      This is all done using JavaScript in InDesign CS 5.5


      Thanks in advance

        • 1. Re: automatically debugging when calling a script from a menu item
          chud1983 Level 1

          just a quick update.

          After stripping back and stubbing out some code I have been able to trigger a "session" going to my "customSession" then to a non-session (the default) so this is not causing my issue.


          As I mentioned above i am using the extendables package and this appears to be where my issue is arrising. as soon as i include the package:

          #include "extendables/extendables.jsx"


          i get the strange behaviour of it going into debugging mode on the first line of the script being run by my menuItem eventHandler.

          This is without actually using any of the modules available in the extendables package just including it.


          I will try to post a message on the website for this package but if anybody has any ideas about what might be in there that is causing this I would appreciate any ideas/suggestions/theories.



          • 2. Re: automatically debugging when calling a script from a menu item
            chud1983 Level 1

            tracked it down to a line in the extendables package:

            $.level = 2;


            I then went to the extendable site on github to raise it as an issue only to find out someone had already reported it I just hadn't seen the issue before. DOH!


            anyway thought i best update incase anyone else on the forums tries to use the package and encounters this issus.