5 Replies Latest reply on Feb 26, 2008 3:27 PM by Harbs.

    How to create Button.

      Hello,

      I am trying to create a button. The name of button should be "Browse".
      This button should be placed below the cancel button(Which is a default button as ok in the script). So, the sequences for the button Browse in the column will be at the top is "ok" button then in middle "cancel" then at the bottom "Browse".

      Thank you,
        • 1. Re: How to create Button.
          Level 1
          Hi Avi,

          Where are you trying to create a button? Which scripting language? Which version of InDesign? Tell us more, and we'll try to answer.

          Thanks,

          Ole
          • 2. Re: How to create Button.
            Level 1
            I am using Indesign cs3. I am using Javascript.
            I want that button should be on user interface(dialog box).

            This button should be placed below the cancel button(Which is a default button as ok in the script). So, the sequences for the button Browse in the column will be at the top is "ok" button then in middle "cancel" then at the bottom "Browse".
            • 3. Re: How to create Button.
              Level 1
              Hi Avi,

              Okay. Are you using the InDesign dialog object (created by app.dialogs.add(), and shown in most of the example scripts), or are you using a ScriptUI dialog box (as shown in the JavaScript Tools Guide)?

              If it's the former, we can stop now, because you can't add other buttons to that object. Instead, consider displaying two dialog boxes--one for the browsing, and another for whatever else you need to do.

              Thanks,

              Ole
              • 4. Re: How to create Button.
                Level 1
                Thank you for your reply.

                yes, I am using app.dialogs.add() function. So, it means that i can not add a button to that object.i am planning to do one thing.

                I will create three button using ScriptUI dialog box one is "Browse" other is "cancel" and "ok". then i will apply the event to each of these button. I knew how to apply event on "Browse" and "cancel".

                But the problem is with ok button. I want t call my original script which i made by app.dialogs.add() is it possible what i am asking or not.

                My aim is to call my origanl script when i click on ok button.
                Can you send me any sample script which has same use as what i am asking for.

                Thank you for your help.
                • 5. Re: How to create Button.
                  Harbs. Level 6
                  If you have a standard "okay" button in script UI, you can just write:
                  (assuming "w" is your dialog)
                  if(w.show()){
                  do your stuff;
                  }


                  Harbs