LAST DAY! 25% OFF Everything* with code: CYBER. Our Cyber Extravaganza is ON! *Click for details

Trim Comp to Contents

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

Author: Zack Lovatt

Subscribe for notifications
Subscribe for new version notifications Subscribe
Name Your Own Price You can pay anything you want, the amount displayed is only a suggested amount.
Add to Wishlist

Quick Overview

Trim or extend comp duration to fit layer contents.

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.
  • Crop Nested Comps - Whether to run through any nested comps (precomps) and trim those as well
  • Preserve Comp Start Time - If comp doesn't start at 0, should the script preserve the start point?


Headless Version

If you're not interested in using the UI panel version, you can use Trim Comp to Contents with your favourite script launcher (like ft-toolbar or Script Launcher). Simply point the launcher/toolbar to the script file, and will run without showing the UI.

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 2024, 2023, 2022, 2021, 2020, CC 2019, CC 2018, CC 2017, CC 2015.3, CC 2015, CC 2014, CC, CS6, CS5.5, CS5, CS4
  • Project Item Labels

    Zack Lovatt

    • Compatibility After Effects

    Project Item Labels

    Set all / specified project item label colours per item type. Good for organizing imported projects.
    Add to Cart
  • Swatcheroo

    Zack Lovatt

    • Compatibility After Effects


    Swatcheroo is your handy dandy swatch pal. That's, uh, short for 'palette.'

    Add to Cart
  • Local Hero

    Zack Lovatt

    • Compatibility After Effects

    Local Hero

    Local Hero saves the day by migrating network assets to your local workstation for improved efficiency.

    Add to Cart
  • Easy Bake

    Zack Lovatt

    • Compatibility After Effects

    Easy Bake

    Convert expressions to keyframes faster, simpler and with more control than ever before.
    Add to Cart
  • Explode Shape Layers 3

    Zack Lovatt

    • Compatibility After Effects

    Explode Shape Layers 3

    Take control of your shape layers! Explode & merge for greater precision.

    Add to Cart
  • Flex

    Zack Lovatt

    • Compatibility After Effects


    Flex is a tool for creating dynamically realigning layouts for your layers.

    Add to Cart
View all Zack Lovatt products