Copy link to clipboard
Copied
function tebb() {
var xx = 0;
var ccr = app.scheduleTask("checkStatus()", 2000, true);
var checkStatus = function () {
if (xx < 5) {
alert(xx);
xx++;
} else {
app.cancelTask(ccr)
}
}
}
tebb()
the above code will not run in AE
but without the function tebb(), it works!
why is happened?
Copy link to clipboard
Copied
Because of the variable, that you are using for the task, has to be a global variable.
Put it outside of the function and everything will work.
Copy link to clipboard
Copied
thanks! make checkStatus be a global and works!