DEV Community

Cover image for Scripting: Beginner's Guide To Creating After Effects Scripts
Kat
Kat

Posted on

Scripting: Beginner's Guide To Creating After Effects Scripts

Contents

Introduction

After spending years with After Effects expressions, it seems natural to branch out into writing custom scripts. However, I found it's not that easy. It can be quite daunting for beginners - with information in the scripting guide available, but with very few practical examples to learn from. I found myself constantly asking "Okay, but how do I apply these functions without throwing an error?"

In this series, I aim to create some basic guides to help you create your own scripts for After Effects. I'll be referencing all the useful information in the scripting guide, but aim to contextualize it a little.

Why Scripts?

So, why make scripts? There are many reasons to create a script for After Effects.

My main reason for wanting to make scripts is to have a tangible, separate file, meaning there's no need to open up or import an existing After Effects project. Instead of copy-pasting information, adjusting sliders, or using the Essential Graphics panel, a script will allow you to create your own panel to store information, or create buttons which can trigger custom code.

In short, they are useful for making templates to hand over to clients, but also for creating shortcuts for yourself and your own workflow. Many of the most popular scripts out there improve efficiency in this way.

Extendscript Toolkit

To create your script, you will need software. Any program which lets you generate a .jsx file will work, but I personally like to use Extendscript Toolkit because it can connect directly into Adobe software while testing.

If you have Adobe Creative Cloud, you will already have access to Extendscript Toolkit, however you may be unaware of this. This is because Extendscript Toolkit is old software, and hidden away from view.

In order to find and download Extendscript Toolkit, open up Creative Cloud, and navigate to your preferences menu. Click on the "Apps" tab, and scroll all the way to the bottom until you find the toggle labelled Show Older Apps.

Screenshot of Adobe Creative Cloud Show Older Apps option

Once this toggle is on, Extendscript Toolkit will be available to download on your app page.

Opening up Extendscript Toolkit, you'll see this:

Screenshot of Extendscript Toolkit

This is where we will write our scripts. At the top, navigate to the dropdown menu Extendscript Toolkit CC. You'll see the option to select any Adobe software currently installed on your machine.

Screenshot of Extendscript Toolkit menu

This will allow you to connect Extendscript Toolkit directly to whichever Adobe program you are writing scripts for. I have selected my most up to date version of After Effects. Now, whenever I press the play button on the top toolbar, it will run the script directly in After Effects without me having to save out the file - which is great for testing things out.

With After Effects open, try adding the following code to Extendscript Toolkit and running it:

var mainWindow = new Window("palette", "My First Window", undefined);
var mainGroup = mainWindow.add("group", undefined);
var mainText = mainGroup.add("statictext", undefined, "Hello World!");


mainWindow.show();
mainWindow.center();
Enter fullscreen mode Exit fullscreen mode

If you have selected the correct version of After Effects, you should see your first window pop up!

Hello World window

We'll go into detail about creating windows and the options available in another article.

Now that you have Extendscript Toolkit installed, you're ready to start making scripts!

Conclusion

Scripts are powerful tools which let us create After Effects templates and improve our own workflows by adding custom, unique tools.

In upcoming articles I will go over:

  • Navigating After Effects and selecting projects and compositions
  • Creating windows and panels
  • Adding new layers and compositions
  • Creating, editing, and animating text layers
  • Creating, editing, and animating shape layers
  • And more!

Let me know in the comments if there is a specific topic you would like to see me cover.

Top comments (0)