2 Replies Latest reply on Feb 25, 2011 4:48 PM by dposluns

    JSX script executed through CSXS timing out?

    dposluns

      So what I originally had was a simple .jsx script that I would execute from the Scripts menu. It would take several minutes to run as it iterates several hundred times making modifications to text layers.

       

      It came time that I wanted to upgrade the script with a Flash interface, which is what I've been working on. Since there is no true asynchronicity to be had, I've modified my .jsx script so that instead of running all in one go, the JavaScript function processes only one item at a time and returns its progress. Meanwhile the Flash interface sits in a loop, calling this function through CSXSInterface.instance.evalScript and updating a progress bar until it reads that there are no more items to process.

       

      Works great in theory, but for some reason the script will randomly stop around the 20th, 50th, whatever iteration, usually with a SyncResult status of InvalidInputParams (which I have NO idea how that could happen, since it's calling the exact same function with no parameters each time, and the function is returns the same XML string each time, with just a different number indicating progress).

       

      I tried experimentally increasing the batch size from 1 to 8 (so that the JavaScript function loops 8 times before returning back to Flash), and now it unceremoniously halts after pretty much every batch.

       

      Is there some kind of hidden execution timeout going on behind the scenes that is causing Flash to bail out of ActionScript when a JavaScript runs too long or something? If so, is there some way of disabling it? If not, does anyone know what could be going on here? Is there some way of dealing with this problem?

       

      Thanks,


      Dan.