9 Replies Latest reply on May 27, 2010 7:20 AM by habaki1

    Bug in event manager ?

    habaki1 Level 1

      Hello !

       

      I installed a JS script that is called on all events by the event manager.

       

      It works very well, but as soon as i try to print a document, Photoshop seems to be blocked. No tools can be used any more, but some menus work.

      The event manager menu answers: General I/O Error

      In this state, the photoshop process must be deleted with the task manager.

       

      I already listened a lot of different events with this scrpt and the problem occurs only on print so far.

       

      The script itself seems not to be the cause. I tested several scripts with less ans less code inside until a simple try catch. Even an empty JSX file shows the problem.

       

      My version is CS4.

       

      Does someone know this problem ?

      Is there a work around ?

       

      Thank you for your help !

       

      P.S: Could someone make a simple test ? Just add an empty .JSX file into the event manager for all events, and try to print a document ?

       

       

       

        • 1. Re: Bug in event manager ?
          habaki1 Level 1

          Hello  again !

           

          In fact Photoshop detects and rejects the case of a totally empty script file (0 byte).

           

          So the test must be made with a JSX file containing at least a space char !

           

          Thank you again for answers about this problem.

          • 2. Re: Bug in event manager ?
            Michael L Hale Level 5

            I did a quick test for you using CS4 Extended 32bit on WinXP and an Epson printer. The event script I used was a simple alert noting the event being handled. When I  print either to Adobe PDF( Acrobat driver ) or my Epson Photoshop ends up in a similar state. Most but nor all of the menu items are disabled including exit. So I am seeing the same problem.

            1 person found this helpful
            • 3. Re: Bug in event manager ?
              Michael L Hale Level 5

              I also just did a quick test in CS5 using the same event scirpt and it works as exppected so it looks like the bug/problem is fixed in that version.

              1 person found this helpful
              • 4. Re: Bug in event manager ?
                habaki1 Level 1

                Thank you Micheal for all your tests !

                 

                The good news is CS5 seems to fix the problem.

                 

                The very bad news is that it is in fact impossible to execute correctly a script on all events in CS4 and probably in all previous versions!  

                • 5. Re: Bug in event manager ?
                  c.pfaffenbichler Level 9

                  Out of curiosity: what kind of Script do you run on all events?

                  • 6. Re: Bug in event manager ?
                    habaki1 Level 1

                    Hello c.pfaffenbichler !

                     

                    My script only needs to catch some events: open, close, select, set, etc...(not all), but it is simplier to install it once for all events.

                    Because :

                    - It can be installed by hand (To install it for each event an installer is needed with a 2nd script).

                    - To catch an additional event, only the script must be modified, not the install process.

                     

                    For this development, i also wrote an "eventviewer" (that prints an event with all arguments into an alert box) to see exactly what is the pattern to match for each action i needed to catch.  This script must be installed for all events.

                     

                    The purpose of the main script is to assign a private context to a document and to each layer of a document: for instance a brush with its diameter, FG and BG colors, etc...

                    • 7. Re: Bug in event manager ?
                      c.pfaffenbichler Level 9

                      Ah; thanks for the explanation.

                      • 8. Re: Bug in event manager ?
                        Michael L Hale Level 5

                        You can have the script itself handle the events. And because each event handler slows Photoshop a little I would just register the events needed. Just put the code to register the events near the top of you script and wrap each notifiers.add in a try/catch.

                         

                        if(!app.notifiersEnabled) app.notifiersEnabled = true;// enable notifiers if needed
                        try{// wrap each notifier in a try/catch statement to avoid error if already registered
                             app.notifiers.add("placedLayerEditContents", new File("C:\\editPlacedEvent.jsx"));
                        }catch(e){}
                        try{// wrap each notifier in a try/catch statement to avoid error if already registered
                             app.notifiers.add("slct", new File("C:\\selectLayerEvent.jsx"), "Lyr " );
                        }catch(e){}
                        
                        • 9. Re: Bug in event manager ?
                          habaki1 Level 1

                          Thank you Michael !

                           

                          It's a good idea but there is a fowl-egg problem ! The script must be started to be installed and installed to be started.

                          I was kidding ! It is easy to detect an execution by hand (arguments.length==0) and to call app.notifiers.add only in this case.

                           

                          Nevertheless an uninstaller is also needed to remove the notifiers added for this script. So i wrote a 2nd script with a user interface to install/uninstall the first. It's better because the drop down list of the event manager is also bugged. Removing only some notifiers often does not work properly.

                           

                          Thanks again.