New Composition

After Effects
April 4, 2025

// Create a new 4K composition (3840x2160)
// adapt the elements below for your personal specs

var compWidth = 3840;
var compHeight = 2160;
var compDuration = 300; // Duration in seconds (300 = 5 minutes)
var compFrameRate = 30; // Frame rate

// Create the composition
var newComp = app.project.items.addComp("4K_Comp", compWidth, compHeight, 1, compDuration, compFrameRate);

// Set the background color (optional)
newComp.bgColor = [0, 0, 0]; // Black background

// Prompt the user for the composition name
var compName = prompt("Enter the name for the new composition:", "4K_Comp");

// Rename the composition with the user-provided name
if (compName !== null && compName !== "") {
   newComp.name = compName;
}

// Open the composition in the viewer
newComp.openInViewer();

How to use the script

Always check code before running it on your computer. Even basic scripts like this one. If you’re not a developer, ask an LLM like ChatGPT, Claude, or Gemini to verify it for you.

Option 1: Install to your AE Folder

Download and install the below .jsx file in your After Effects Script folder. You can then run it using the scripts menu, or by using a launcher like Quick Menu 3.

Option 2: Adapt the script yourself

Alternatively copy the code below and develop your own version. If you’re not a developer you can do this easily with an LLM like ChatGPT.

Research, interviews, and tools for modern motion designers.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.