6 Replies Latest reply on Jul 2, 2009 7:47 AM by Huksy

    [JS CS3] Add shortcutKey to Button?

    Huksy

      I wrote a script with a UIdialog asking for replacing several things or not. It works fine but I'm not able to add a shortkey to my "replace"-button?

      Did anyone know what I've forgot or done wrong?

       

      ...

      var myDialog = new Window('dialog', 'Search and Replace', undefined, {maximizeButton:false, minimizeButton:false});
      with(myDialog){
          with(add('group')){
              myReplaceButton = add('button', undefined, "Replace", {name:'ok'});
              myReplaceButton.shortcutKey = "F3";
              myReplaceButton.onClick = function(){ myDialog.close(1) };
              myReplaceButton.onShortcutKey = function(){ myDialog.close(1) };

              myCloseButton = add('button', undefined, "Cancel", {name:'cancel'});
              myCloseButton.onClick = function(){ myDialog.close(2) };
            }
      }

      ...

       

      Regards

      H.