Hmmh?
Same problem as your last thread - the logic of your script isn't really good!!!
Why you do not use the structure I showed you there: A script third part unfunction can you fix it?
Here is the script I've posted there (extended now with alerts)
//---------------------------------------------------------------------------------------- ------------------------------------------------------------------------------- //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(); // for save function //alert("saved") return; } if (mySelection.selectedIndex == 1){ close_file(); // for close function //alert("saved") return; } if (mySelection.selectedIndex == 2){ revert_file(); // for reverse function //alert("saved") return; } } function save_file(){ // colse_file() for (var i = docs.length-1; i >= 0; i--) { docs[i].close(SaveOptions.YES); // for every file //alert("saved") } return; // sorry, the return was on the wrong place before } function close_file(){ for (var i = docs.length-1; i >= 0; i--) { docs[i].close(SaveOptions.NO); // for every file //alert("closed") } return; // sorry, the return was on the wrong place before } function revert_file(){ app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract; app.documents.everyItem().revert(); app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; // this is not a loop //alert("reversed") return; } //---------------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Activating the alerts you want should easy fix your problem.
Have fun