Quick debug ...
var a="A) ",b="B) ",c="C) ",d="D) ",e="E) ",s,k;
//
mDialog()
//
mFunction()
//
function mDialog(){
var w = new Window("dialog");
w.orientation = "row";
w.alignChildren = "left";
var sA = w.add("statictext", undefined, "A)");
var sAtext = w.add("edittext", [0, 0, 35, 20]);
sAtext.active = true;
var sB = w.add("statictext", undefined, "B)");
var sBtext = w.add("edittext", [0, 0, 35, 20]);
//
var cancelButton=w.add("button", undefined, "Cancel", {name: "cancel"});
var okButton = w.add("button", undefined, "TAMAM", {name: "ok"});
if (w.show () == 1){
s = Number(sAtext.text);
k = Number(sBtext.text);
if ((isNaN(s)) || (isNaN(k))){
alert("Not a number");
exit();
}
}else{
exit();
}
}
//
function mFunction(){
if (app.selection[0].characters.length > 0){
app.selection[0].texts[0].remove();
}
app.selection[0].texts[0].insertionPoints.item(-1).contents = a + ((s*1) + (k * 0));
app.selection[0].insertionPoints[-1].contents = SpecialCharacters.FLUSH_SPACE;
app.selection[0].texts[0].insertionPoints.item(-1).contents = b + ((s*1) + (k * 1));
app.selection[0].insertionPoints[-1].contents = SpecialCharacters.FLUSH_SPACE;
app.selection[0].texts[0].insertionPoints.item(-1).contents = c + ((s*1) + (k * 2));
app.selection[0].insertionPoints[-1].contents = SpecialCharacters.FLUSH_SPACE;
app.selection[0].texts[0].insertionPoints.item(-1).contents = d + ((s*1) + (k * 3));
app.selection[0].insertionPoints[-1].contents = SpecialCharacters.FLUSH_SPACE;
app.selection[0].texts[0].insertionPoints.item(-1).contents = e + ((s*1) + (k * 4));
}
... View more