Skip to main content
Known Participant
February 25, 2008
Question

How to create Button.

  • February 25, 2008
  • 4 replies
  • 800 views
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,
This topic has been closed for replies.

4 replies

_Avi_Author
Known Participant
February 26, 2008
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.
Harbs.
Legend
February 26, 2008
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
Known Participant
February 26, 2008
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
_Avi_Author
Known Participant
February 26, 2008
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".
Known Participant
February 26, 2008
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