Open a comp in After Effects that has expression snippets.
Use the different options in the expression editor to customize your expressions.
You can customize the code editor interface of the expression editor, including highlighting JavaScript syntax with custom colors, line numbers, code folding, and auto-complete. To customize these options, select After Effects > Settings > Scripting & Expressions.
Expression editor code interface
Customize syntax highlighting of JavaScript syntax and After Effects methods and properties
- You can assign custom colors to different types of syntax, the background, and the text selection, as well as adjust the alpha ( opacity ) of the text selection. Select the dropper icon to select a color from the color wheel.
- You can customize how the expression editor looks based on the different themes available. Select the Theme drop-down list and select from the themes. You may also save custom themes.
Edit preferences
Code Preview box
All changes to the syntax colors and other editor preferences can be previewed live in this code preview box.
Use throw to debug expressions inline. This is useful when you want to see the code error within the expression editor field to save time and ensure efficient debugging.
Example 1: Display error in your code snippet
In the Timeline panel, select a layer and use Alt+Click to display the expression in the Expression Editor field.
Select the editor field to enter the edit mode.
In this example, select MILE in the first line and change it to mile in lowercase. This triggers an error in the code, and After Effects displays an error message within the code snippet.
After Effects also displays an error banner with details about the line number where the error occurs.
Example 2: Auto-suggestions based on the commonly used components
In the same expression, change the layer name from mile to MILE.
As you type, After Effects displays a drop-down list with a set of suggestions that After Effects pulls from the layer names of the project.
Composition names, layer names, footage names, and effect names are all pulled into the autoComplete and shown in the correct context with their respective comp(), layer(), footage(), and effect() methods. This allows you to keep your expression active while referencing items in the project. You don't need to scroll the timeline or open other panels to refer to properties or items using the pick whip.
More Expression resources
Now that you have understood some of the concepts behind expressions, come to the community for some real-life examples, and to share your work.
The AE Enhancers forum also provides many examples and much information about expressions, as well as scripts and animation presets.
Create stunning 3D animations in After Effects
Animate characters and illustrations, add motion to text, and more.