14 Replies Latest reply on Feb 13, 2012 6:28 PM by bizmac

    Mouse issues

    Clevadio

      I have a script calling a script that is using free transform and it makes my mouse inoperable. Any suggestions?

        • 1. Re: Mouse issues
          JJMack Most Valuable Participant

          Recycle the mouse and delete the scripts.

          • 2. Re: Mouse issues
            Clevadio Level 1

            I tried that. It did not work.

            • 3. Re: Mouse issues
              Michael L Hale Level 5

              Do you mean the mouse freezes up and stops moving?

              • 4. Re: Mouse issues
                Clevadio Level 1

                I can move the mouse around and use it outside of photoshop but  I can't manipulate the bounding box on the free transform.

                • 5. Re: Mouse issues
                  Michael L Hale Level 5

                  Can you post your code? Below is the function to transform a layer that I use and the mouse works with it.

                   

                  function transformLayer(){
                  try{ 
                      var desc = new ActionDescriptor();
                          var ref = new ActionReference();
                          ref.putEnumerated( app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt') );
                      desc.putReference( app.charIDToTypeID('null'), ref );
                      executeAction( app.charIDToTypeID('Trnf'), desc, DialogModes.ALL );
                      }catch(e){ 
                    if (e.toString().match(/User cancelled/)) { 
                         return -1; 
                         }else{ 
                        throw e; 
                        }
                    }
                  };
                  
                  • 6. Re: Mouse issues
                    Clevadio Level 1

                    The code that I have is essentially the same as what you have but the problem only exists when I call a script containing a transform from another script.

                    • 7. Re: Mouse issues
                      JJMack Most Valuable Participant

                      Code I used from scriptlistner for menu Edit>Free transform that also works looks like this

                      //==================== Interactive Transform ==============

                      function InteractiveTransform() {

                        // Menu Edit>Free transform

                          var desc1 = new ActionDescriptor();

                          var ref1 = new ActionReference();

                          ref1.putEnumerated(cTID('Mn  '), cTID('MnIt'), cTID('FrTr'));

                          desc1.putReference(cTID('null'), ref1);

                          executeAction(cTID('slct'), desc1, DialogModes.NO);

                      };

                        //used this way

                      try{

                         InteractiveTransform()

                      }catch(e){alert("Image Transform Canceled");}

                       

                      You can also ignore cancel

                      }catch(e){}

                      • 8. Re: Mouse issues
                        JJMack Most Valuable Participant

                        The doctor says if it hurts don't do it. Code the transform inline or include embed the script to make a single script.

                        • 9. Re: Mouse issues
                          bizmac

                          I have experienced this issue several times.  When the transform starts all mouse clicks on the photoshop window result in a ding sound and nothing else, but you can still use the keyboard keys to move the layer around.  This happened with scripts as well as calling actions with transforms. 

                           

                          In trying to reproduce this in a simple script to post here I realized that it was not the doAction of $.evalfile that was causing the problem.  It seems that it was caused by calling the transform from within a dialog event handler.  Here is how i reproduced the error.

                          w =  new Window("dialog");

                          go = w.add("button", undefined, "GO");

                          go.onClick = function(){w.close(); gonow();}

                          w.show();

                           

                          function gonow() {   

                                     try{app.runMenuItem(charIDToTypeID("FrTr"));}catch(e){}     // using doAction to call an action with a transform will also result in loss of mouse control                

                          }

                          I have moved the transform out of the the event handler  and set a variable to tell it wether or not to run and solved the issue.

                           

                          var dogonow = false;

                          w =  new Window("dialog");

                          go = w.add("button", undefined, "GO");

                          go.onClick = function(){w.close(); dogonow = true;}

                          w.show();

                           

                          if(dogonow == true){gonow();}

                          function gonow() {   

                                     try{app.runMenuItem(charIDToTypeID("FrTr"));}catch(e){}       //  yay, i can use the mouse!          

                          }

                          • 10. Re: Mouse issues
                            Clevadio Level 1

                            bizmac,

                              Thanks for the assist.

                            • 11. Re: Mouse issues
                              JJMack Most Valuable Participant

                              Both of those script work without any problems on my Windows XP Professional system with CS5???

                              • 12. Re: Mouse issues
                                bizmac Level 1

                                I can reproduce this on multiple machines running CS5 or 5.1 on Windows 7 x64.  Maybe it has something to do with that, but thats all i have to test with right now.

                                • 13. Re: Mouse issues
                                  JJMack Most Valuable Participant

                                  I just tested your two scripts on my window 7 machine. They both work without a problem in CS5 64bit and 32bit....

                                  • 14. Re: Mouse issues
                                    bizmac Level 1

                                    I just did a fresh install of photoshop cs5 32 bit trial on my  XPSP3 laptop.  I didnt change any settings in photoshop. I get the same results as on windows 7.  the first snippet I posted results in me being unable to move the transform with the mouse.  The second snippet I can. If it was a windows or photoshop setting causing this behavior I would like to find out.  Anybody else out there want to try it out?