Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Trim Comp to Work Area

  • Trim Comp to Work Area

    Posted by Nick Leigh on May 9, 2014 at 3:39 am

    I have searched google and this forum and found the following code to trim my comp to the work area:


    videoComp.workAreaDuration = 0.6;
    videoComp.ramPreviewTest("",0.33,"");
    videoComp.workAreaDuration = settings.compLength;
    app.executeCommand(app.findMenuCommandId("Trim Comp to Work Area"));

    I am using AE CS5

    The problem is that I am getting an error every time I run my script. The error states:

    Unable to execute script at line 103. After Effects error:RAM Preview needs 2 or more frames to playback. Line 103 is the ramPreviewTest line.

    Thanks for the help.

    CS5 Production Suite

    Nick Leigh replied 12 years ago 2 Members · 2 Replies
  • 2 Replies
  • Kevin Camp

    May 9, 2014 at 5:45 pm

    you would commonly see that error if the cti was at the end of the comp work area and tried a ram preview from current time.

    if that’s the case here, then you may need something in the script to either do a ram preview for the whole work area, or move the cti from the last frame of the comp/work area.

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Nick Leigh

    May 9, 2014 at 9:00 pm

    Ok so I tried your solution and set the current time to 0 and I was still getting the same error. Here is what I am doing:


    videoComp.time = 0;
    videoComp.workAreaDuration = 1;
    videoComp.ramPreviewTest("",0.33,"");
    videoComp.workAreaDuration = settings.compLength;
    app.executeCommand(app.findMenuCommandId("Trim Comp to Work Area"));

    Is there a way to simply set the comp duration of length?

    CS5 Production Suite

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy