Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Why the alert massage return twice on the screen?

$
0
0

Hi, everyone

 

I got this script:

 

var

  mySelected = Number( app.extractLabel("mDialog") ),

  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)

    main();

myDialog.destroy();

 

function main(){

      colse_file();

}

 

function colse_file(){

    if (mySelection.selectedIndex == 0){

var docs = app.documents;

    for (var i = docs.length-1; i >= 0; i--) {

        docs[i].close(SaveOptions.YES);

}

alert("Done.\rAll files are saved.");

}

 

    if (mySelection.selectedIndex == 1){

    var docs = app.documents;

    for (var i = docs.length-1; i >= 0; i--) {

        docs[i].close(SaveOptions.NO);

}

alert("Done.\rAll files are closed without save.");

}

 

   if (mySelection.selectedIndex == 2){

var docs = app.documents;

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;

app.documents.everyItem().revert();

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

}

alert("Done.\rAll files are reversed.");

}

 

 

Why the alert massage return twice on the screen?


 

VK


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>