my Find & replace Dialog
Hi All
I am writing a script which can user to allow find, remove and skip dialog.
See my below JS code it is working but I can only get alert message not dialog.
Could anybody please help me out of this. Is it posible it works like a find & replace dialog box.
Please cooperate me.
Thanks,
Kerosk
myDialog = new Window("dialog", "MyFindDialog");
myDialog.myFnBtn = myDialog.add("button", undefined, "Find Next");
myDialog.myFnBtn.onClick = function()
{
myDialog.close(0);
}
myDialog.myRmBtn = myDialog.add("button", undefined, "Remove");
myDialog.myRmBtn.onClick = function()
{
myDialog.close(1);
}
myDialog.mySkBtn = myDialog.add("button", undefined, "Skip");
myDialog.mySkBtn.onClick = function()
{
myDialog.close(2);
}
//myDialog.center();
var myDlg = myDialog.show();
if(myDlg == 0)
{
EmptyTf= app.activeDocument.layers.item(0).textFrames;
for (etf=0; etf<EmptyTf.length; etf++)
if (EmptyTf[etf].contents<=0)
{
app.select(EmptyTf[etf]);
alert ("Selected is EMPTY Textframe.\r"+"Textframe selected "+[etf]+".");
}
}
else if(myDlg == 1)
{
EmptyTf= app.activeDocument.layers.item(0).textFrames;
for (etf=0; etf<EmptyTf.length; etf++)
if (EmptyTf[etf].contents<=0)
{
app.select(EmptyTf[etf]);
var select=app.selection[etf];
select.remove();
alert ("Selected is EMPTY Textframe.\r"+"Delete "+[etf]+".");
}
}
else if(myDlg == 2)
{
EmptyTf= app.activeDocument.layers.item(0).textFrames;
for (etf=0; etf<EmptyTf.length; etf++)
if (EmptyTf[etf].contents<=0)
{
app.select(EmptyTf[etf]);
var select=app.selection[0];
var select=app.selection[etf+1];
alert ("Next"+[etf]+".");
}
}