skip to Main Content

JavaScript vs. Legacy ExtendScript

JavaScript notes banner

What’s up with the JavaScript change?

If you’re like me, you took no notice when Adobe updated After Effects’s expression engine. This isn’t about the change in the expression field, where different components of your expression are represented by different color text as well as some other changes. This is about an update from ExtendScript, based on ECMASCript 3 (1999), to ECMAScript 2018 which occurred with the release of After Effects 16.0 (2020). You would expect such a long chasm between updates would cause some problems with scripts written before the change, and the answer to that, like so many things in life, is: it depends.

Any scripts crashing that weren’t before?

While there are scripts that can run on both Legacy ExtendScript and JavaScript, you may find a script that you used in the past is now throwing errors at you. Or, in my case, I discovered this JavaScript change when I was trying out a new script from AEscripts + Plugins and it produced errors. I opened a support ticket, and this is what Sam, the tech guy, wrote:

Basically in short, After Effects added a new expression engine… but didn’t really announce it and what that means. It means you get faster and better expressions but they are not cross compatible with the older version expression engine and thus you have to switch between them.

When opening a pre 2020 version of after effects it automatically sets it to legacy and because of this the expression will work. But when creating a new project it doesn’t change it over to javascript and ends up creating an error when you use most scripts.
Support Ticket, AE Scripts + Plugins, Sam, 6 Feb 2020

If this happens to you, the cure is simple.


[left] To change the type of JavaScript After Effects will use, you have to click on the Project Settings button located at the bottom of the Project Panel (rocket icon).

[right] When the Project Panel opens, click on the Expressions tab. You’ll find a pull-down menu which will allow you to change the JavaScript engine.

Write expressions and want to know more?

All of the basic expressions on this website are compliant with the new engine, so no worries there. Adobe does have a page explaining the changes, including a new expression posterizeTime(0) which can freeze property values which I may explore in a Quick Tip video. You can find the page at: Syntax differences between the JavaScript and Legacy ExtendScript expression engines

Back To Top