Copy link to clipboard
Copied
If we run script then it should display 6 button along with ok, cancel button. If we click on button1 then the coding assciated with button1 should execute and so on.
button1
button2
button3
button4
button5
button6
Ok Cancel.
Virender
...// DialogSimpleButton.jsx
// http://forums.adobe.com/thread/1327372?tstart=0
// how to add buttons in script, which on click run different codes?
// regards pixxxelschubser
function SimpleDialog() {
var w = new Window('dialog', '');
this.windowRef = w;
w.orientation = "column";
btn1 = w.add('button',undefined,'Button 1');
btn2 = w.add('button',undefined,'Button 2');
btn3 = w.add('button',undefined,'Button 3');
btn4 = w.add('button',undefined,'Button 4');
btnOK = w.add('button',undefined,'OK');
btnCancel = w.
Copy link to clipboard
Copied
Only by using a palette with BridgeTalk.
Here you can see a simple example:
Copy link to clipboard
Copied
Hi,
I am sorry I was not clear enough to explain my requirement. the codes which will exeute will remain in a single scirpt. all in all only one script file. I am new for create button and assign code to that button so any help will be great.
button1 // alert("button1")
button2 // alert("button2")
button3 // alert("button3")
button4 // alert("button4")
button5 // alert("button5")
button6 // alert("button6")
Ok Cancel.
If i click on button2 then respective code should exceute e.g. alert("button2") in this case.
Copy link to clipboard
Copied
// DialogSimpleButton.jsx
// http://forums.adobe.com/thread/1327372?tstart=0
// how to add buttons in script, which on click run different codes?
// regards pixxxelschubser
function SimpleDialog() {
var w = new Window('dialog', '');
this.windowRef = w;
w.orientation = "column";
btn1 = w.add('button',undefined,'Button 1');
btn2 = w.add('button',undefined,'Button 2');
btn3 = w.add('button',undefined,'Button 3');
btn4 = w.add('button',undefined,'Button 4');
btnOK = w.add('button',undefined,'OK');
btnCancel = w.add('button',undefined,'Cancel');
btn1.onClick = function() {alert("Button 1");};
btn2.onClick = function() {alert("Button 2");};
btn3.onClick = function() {alert("Button 3");};
btn4.onClick = function() {alert("Button 4");};
defaultElement = btnOK;
cancelElement = btnCancel;
btnOK.active = true;
btnOK.onClick = function() {
stuff = "your stuff";
w.close();
}
w.show();
}
var stuff = null;
SimpleDialog ();
if (stuff) alert(stuff);
Copy link to clipboard
Copied
Thanks for the help again (previous help on 6th sept).
i will add my code in this script to complete my requirement. Lets see............
Regards
Virender