[NOTE: I have tried to upload repro .zip, but it system didn't allow me to do so, so I have uploaded it as .pptx (this forum does not allow uploading of .zip / .aep / .jsx / ...). To repro the issue please download repro.pptx attachment and then rename it to repro.zip]
Hi, I have an issue to report, related to the expression evaluation from scripting. If you are to open project, to add expression and to read its value inside of the same script, results might be invalid (they are reproducibly invalid for sampleImage at least). If you were to open project inside of the script, then finish the script, then add expression and read its value inside of another script everything would work as expected.
I have much more complicated examples, but attached is the minimal repro - I'm using sample image to detect whether image has any transparency (it does not). script1.jsx, which does everything inside a single script, returns that image is transparent, which is wrong. script2.jsx which opens project in script, and then schedules everything else in another script returns image is not transparent, which is correct. You could invoke these scripts from the console and look for the result in the console, something like the attached screenshot.
Again, I have much more complicated examples, this is the minimal repro of the problem. You can imagine all the problems that this can cause, mainly code based, as app.schelduleTasks() needs to be used and everything needs to be written in callbacks, and callbacks cause hell.... And in general, that is not correct behavior and you should jump through loops to find this kind of workaround.
PS. Even worse, if in script1 I render the comp with the footage and the text, text is correctly rendered out as false, even though its value is true in scripting both before and after the render. So, in the same script:
- I prepare everything and get the text layer value - it is true
- I render it out - in the render it is false (attached)
- After the render I get the text layer value - it is still true