workAreaStart and workAreaDuration behaviour in ExtendScript
Dear forum,
I try to copy the workAreaStart and workAreaDuration from one comp to another, but I don't understand the results. There are two identical comps in a project. Manually I set the start and duration in one comp and by script I want it to be applied to the other. But when I change the workarea (start and duration) of the first comp, run the script and repeat all this a few times, the second comp's workarea is quite different then the source. The debug output is giving the right frames, it's just somehow applied different to the destination.
Why and How? Can somebody explain me what is going on? Many thanks!
The script needs only 2 comps.
var sourceComp = app.project.item(1);
var destComp = app.project.item(2);
var frameStart = Math.round(sourceComp.workAreaStart * sourceComp.frameRate);
var frameDuration = Math.round(sourceComp.workAreaDuration * sourceComp.frameRate);
// alert(frameStart+”, “+frameDuration);
destComp.workAreaStart = frameStart/sourceComp.frameRate;
destComp.workAreaDuration = frameDuration/sourceComp.frameRate;
destComp.openInViewer();
