Remove the gaps in AE comps

Here’s a simple script that will remove a gap in an After Effects timeline, ripple editing all the layers after it. To use it, place the playhead in a gap —  part of the timeline that has no active layers — and run the script. Layers that start after the gap get nudged up so that the gap disappears. The length of the comp is adjusted so that there is no empty space at the end. It’s like the memory hole—the gap never existed; we have always been at war with Eastasia.

before and after

Download the .jsx file below. It’s all open source, I’ll hoist it up on my github when I have a second.


You can download this script along with all my other scripts here. Or to download just this script click the download button below.


After Effects will take care of the installation for you. For scripts without a UI, go to the File menu in AE and choose Scripts>Install Script. Point it at the unzipped .jsx file that you just downloaded and let it work its magic, then restart AE.

Running the script

Scripts without a GUI can be run from the File>Scripts> menu. Once the script is installed it should appear in this menu, or you can run it without installing it using File>Scripts>Run Script File. If you use them a lot you can assign a keyboard shortcut to them.

The image, in case you’re wondering is the Pine Gap spy base that the US operates in Australia. Many people think that letting the CIA and US military conduct drone strikes from Australian territory might not be a good thing. Unfortunately this script won’t get rid of that particular gap.


  1. Looks like a great script. Is there anyway to have it ignore locked layers? If my comp has a VO it usually extends the entire length of the comp and a gap would never be detected.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.