Thanks for your reply
i tried what you suggested by alternating into this :
var myResult = myDialog.show();
if(myResult == true){
switch(myRangeButtons.selectedButton){
case 0:
myObject = app.documents.item(0);
myFindChangeByList(myObject);
break;
case 1:
if (app.selection.lenght instanceof Array)
for (var b=0;b<app.selection.lenght; b++)
myObject = app.selection[b].parentStory;
myFindChangeByList(myObject);
break;
case 2:
myObject = app.selection[0];
myFindChangeByList(myObject);
break;
}
myDialog.destroy();
}
else{
myDialog.destroy();
}
}
but now i get error for the line 178
var myFoundItems = myObject.changeGrep();
error number: 21 error string: undefined is not an object
where is the problem??