Trim Comp to Contents

  • Compatibility After Effects
    Please check exact version compatibility under the "COMPATIBILITY" tab below

Author: Zack Lovatt

Name Your Own Price You can pay anything you want, the amount displayed is only a suggested amount.
License terms

Quick Overview

Trim or extend comp duration to fit layer contents.
Add Your Tags

Trim Comp to Contents

More Views


This script trims or lengthens your current comp duration to the in & out points of its contents, without affecting layer timing relative to one another.

If you have layers extending past the beginning or end of your composition, the script will extend the comp to fit them as well.

By default, the script will trim to all layers in your comp (including locked layers), though there are options to change functionality.



  • Trim to All - Trim to all layers (if checked) or selected layers (if unchecked).
  • Ignore Locked Layers - Consider locked layers for trimming, or leave them out of the logic.
  • Preserve Comp Start Time - If comp doesn't start at 0, should the script preserve the start point?


Headless Version

Also included in the zip is a "headless"/noUI version -- standard users should only be concerned with installing the file to their ScriptUI folder, which will give you a dockable panel.

However, if you use something like ft-toolbar or Script Launcher, you may want to be able to run the script directly without fiddling with the UI panel. That's where this version come in.

Link the noUI version to your launcher/toolbar, and press the button to trim comp to all layers. Using the following modifier keys, you can alter functionality in a few ways.

  • Alt / Option – Use selected layers only (vs all)
  • Shift – Ignore locked layers
  • Ctrl / Cmd – Preserve comp start time


Originally requested by Alan Fregtman.

After Effects CC, CS6, CS5.5, CS5, CS4