Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: How To Exit A Script?

$
0
0

What I do is set up a variable at the very start to shut down things and then have that variable checked to either run the script to stop.  so something like this:

 

var exitProg = false;

 

if(some condition met){runProg}

else{exitProg = true}

 

function runProg{

Your code here...

if(another condition checked){

secondFunction()

More code}

else{

exitProg = true;

return}

}

 

function secondFunction(){

More code here.....

}

By setting the exitProg= true, you can then write your program to skip over everything else and just finish without running any more code.


Viewing all articles
Browse latest Browse all 27456

Trending Articles



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