3 Replies Latest reply on Dec 6, 2012 2:47 AM by Cenchen

    How to change Ok button name on the dialog.

    govind_85 Level 1

      Hello,

       

      I have added dialog by using follwing code.By using this code automatically ok anad cancel button added on to dialog.

       

      var myRetryDialog = app.dialogs.add({name:"Retry Dialog.."});

      with(myRetryDialog.dialogColumns.add()){

          staticTexts.add({staticLabel:"please,click to retry to run script."});

       

      }

      muRetryDialog.show();

       

      what changes required in above code for changing  name of "ok" button to "Retry"?please,help me.

        • 1. Re: How to change Ok button name on the dialog.
          [Jongware] Most Valuable Participant

          govind_85 wrote:

           

          what changes required in above code for changing  name of "ok" button to "Retry"?

           

          It doesn't need changes, but a total re-write. You are using "old style" dialogs here, which do not support custom buttons. To add custom buttons, use ScriptUI: http://forums.adobe.com/docs/DOC-1025

           

          See http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/indesign/pdfs/InDes ignCS5_ScriptingGuide_JS.pdf -- page 111 onwards for a discussion of available widgets for old style dialogs (in particular, the absence of "buttons").

          • 2. Re: How to change Ok button name on the dialog.
            TᴀW Adobe Community Professional & MVP

            And the truth is that a simple script UI window is hardly more difficult

            to write, nor is it significantly longer code, than the simplified

            dialogs. So I've taken to always writing ScriptUI dialogs, even for

            simple things. That way if I ever need to quickly expand a script I

            don't need to rewrite the dialog routine!

             

            Ariel

            • 3. Re: How to change Ok button name on the dialog.
              Cenchen Level 2

              @govind

                                  Try this,

               

               

                                                

              var myRetryDialog = new Window ("dialog", "Retry Dialog..");

                        var stxt = myRetryDialog.add ("group");
                        stxt.add ("statictext", undefined, "please,click to retry to run script.");
                       
                                    
                         var myButtonGroup = myRetryDialog.add ("group");
                         var ok = myButtonGroup.add ("button", undefined, "Retry");
                         var cancel = myButtonGroup.add ("button", undefined, "Cancel");
                       
                         ok.onClick = function()
                          {
                              /*  Retry Process Here  */
                              myRetryDialog.close()
                           }
                          cancel.onClick = function()
                          {
                                  myRetryDialog.close()
                           }
                      
                         myRetryDialog.show();