Question

For example, I have an action like this:

Run external JS => Save file => Run External Bat

The problem is, is there any way in the JS to skip the save file activity?

What I would like to do in the JS is:

if (some condition) {
     //Skip the save file activity
}

Is it possible or any workaround can achieve the same result? Thanks

Reference: http://www.adobe.com/devnet/acrobat/javascript.html

Était-ce utile?

La solution

Depending on the context of what you are trying to accomplish using the continue statement might be of help here. In this example you use it to bypass printing #24.

Outer:
for (var i = 1; i <= 10; i++) {
    document.write ("<br />");
    document.write ("i: " + i);
    document.write (" j: ");

Inner:
    for (var j = 21; j <= 30; j++) {
        if (j == 24) {
             continue Inner;
        }
        document.write (j + " ");
    }
}

//Output:
//i: 1 j: 21 22 23 25 26 27 28 29 30 
//i: 2 j: 21 22 23 25 26 27 28 29 30 
//i: 3 j: 21 22 23 25 26 27 28 29 30 
//i: 4 j: 21 22 23 25 26 27 28 29 30 
//i: 5 j: 21 22 23 25 26 27 28 29 30 
//i: 6 j: 21 22 23 25 26 27 28 29 30 
//i: 7 j: 21 22 23 25 26 27 28 29 30 
//i: 8 j: 21 22 23 25 26 27 28 29 30 
//i: 9 j: 21 22 23 25 26 27 28 29 30 
//i: 10 j: 21 22 23 25 26 27 28 29 30

http://msdn.microsoft.com/en-us/library/ie/8de3fkc8(v=vs.94).aspx

Autres conseils

Add a boolean variable called isSaved in order to execute based on your condition.

var isSaved = false;      
if( isSaved ) {
//if true save the file
}
//Run External Bat

Hope you got an idea.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top