BackgroundTask.setFinishedCallback() || How to get status....
-
How do I get the isFinished or wasCancelled state for scripting?
You can see what I did. Although my function seems to complete (do what I expect), I dont see either of the first two Console.print()'s or the one inside my isFinished() check.obviously I stole this little part from docs. Everything else seems to be working fine, I just get no action out of this part for some reason....
// We can use the finish callback to show / hide some elements bgFindTokens.setFinishCallback(function(isFinished, wasCancelled) //////////////////////// { bgFindTokens.setProgress(0.0); Console.print("Finished: " + isFinished); Console.print("Cancelled: " + wasCancelled); /// if (isFinished)// <-----I tried this too... if (bgFindTokens.isFinished) { Console.print("We FINISHED"); } });