@Jump_Over,
that's right.
But the logic of this script isn't really good.
IMHO this (only quick and dirty, and not tested saving and closing) should be a little bit better:
//---------------------------------------------------------------------------------------- ------------------------------------------------------------------------------- //var mySelected = Number( app.extractLabel("mDialog") ), var myDialog = app.dialogs.add({name:"Colse files save \"Yes\" or \"No\"",canCancel:true}); with(myDialog){ with(dialogColumns.add()){ with(dialogRows.add()){ var mySelection = dropdowns.add({stringList:["01 Yes", "02 No", "03 Reverse"], selectedIndex: 0}); } } } if (myDialog.show() == true) { var docs = app.documents; main(); myDialog.destroy(); } function main(){ if (mySelection.selectedIndex == 0){ //colse_file(); save_file(); return; } if (mySelection.selectedIndex == 1){ close_file(); return; } if (mySelection.selectedIndex == 2){ revert_file(); return; } } function save_file(){ // colse_file() for (var i = docs.length-1; i >= 0; i--) { docs[i].close(SaveOptions.YES); //return; } return; //edited, the return was on a wrong place before } function close_file(){ for (var i = docs.length-1; i >= 0; i--) { docs[i].close(SaveOptions.NO); //return; } return; //edited, the return was on a wrong place before } function revert_file(){ app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract; app.documents.everyItem().revert(); app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; return; } //---------------------------------------------------------------------------------------- -------------------------------------------------------------------------------