Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

How do I get a script to stop execution?

$
0
0

I'm brand new to scripting in Photoshop and coding in Java, and I need help. I want to ask the user a question and if they say "yes" I want the script to completely stop. If "no" I want it to continue.

Is there a way to do this? I've seen examples that look like this one below using "return", and they all say it will work. But all that does is stop the function, not the entire script.

 

=============

function EndScript() { 

    return; 

    alert('this line will never execute'); 

 

var PromptUser = confirm("Do you want to stop?");

     if(PromptUser ){

        EndScript();

    }

 

alert("If the user clicks yes, I don't want this line to execute.");

=============

 

Isn't there some kind of statement that will just stop everything?

Thanks for your help.


Viewing all articles
Browse latest Browse all 12244

Trending Articles



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