- After Effects User Guide
- Beta releases
- Getting started
- Projects and compositions
- Importing footage
- Text and Graphics
- Motion Graphics
- Work with Motion Graphics templates in After Effects
- Use expressions to create drop-down lists in Motion Graphics templates
- Work with Essential Properties to create Motion Graphics templates
- Replace images and videos in Motion Graphics templates and Essential Properties
- Animate faster and easier using the Properties panel
- Drawing, Painting, and Paths
- Overview of shape layers, paths, and vector graphics
- Paint tools: Brush, Clone Stamp, and Eraser
- Taper shape strokes
- Shape attributes, paint operations, and path operations for shape layers
- Use Offset Paths shape effect to alter shapes
- Creating shapes
- Create masks
- Remove objects from your videos with the Content-Aware Fill panel
- Roto Brush and Refine Matte
- Layers, Markers, and Camera
- Animation, Keyframes, Motion Tracking, and Keying
- Motion tracking
- Transparency and Compositing
- Adjusting color
- Effects and Animation Presets
- Effects and animation presets overview
- Effect list
- Effect Manager
- Simulation effects
- Stylize effects
- Audio effects
- Distort effects
- Perspective effects
- Channel effects
- Generate effects
- Transition effects
- The Rolling Shutter Repair effect
- Blur and Sharpen effects
- 3D Channel effects
- Utility effects
- Matte effects
- Noise and Grain effects
- Detail-preserving Upscale effect
- Obsolete effects
- Expressions and Automation
- Expression basics
- Understanding the expression language
- Using expression controls
- Editing expressions
- Expression errors
- Using the Expressions editor
- Use expressions to edit and access text properties
- Expression language reference
- Expression examples
- Immersive video, VR, and 3D
- Construct VR environments in After Effects
- Apply immersive video effects
- Compositing tools for VR/360 videos
- Tracking 3D camera movement
- Work in 3D Design Space
- 3D Transform Gizmos
- Do more with 3D animation
- Preview changes to 3D designs real time with the Mercury 3D engine
- Add responsive design to your graphics
- Views and Previews
- Rendering and Exporting
- Basics of rendering and exporting
- H.264 Encoding in After Effects
- Export an After Effects project as an Adobe Premiere Pro project
- Converting movies
- Multi-frame rendering
- Automated rendering and network rendering
- Rendering and exporting still images and still-image sequences
- Using the GoPro CineForm codec in After Effects
- Working with other applications
- Collaboration: Frame.io, and Team Projects
- Memory, storage, performance
- Knowledge Base
A script is a series of commands that tells an application to perform a series of operations. You can use scripts in most Adobe applications to automate repetitive tasks, perform complex calculations, and even use some functionality not directly exposed through the graphical user interface. For example, you can direct After Effects to reorder the layers in a composition, find and replace source text in text layers, or send an email message when rendering is complete.
For a description of the scripting capabilities available with After Effects, see the After Effects Scripting Guide on the After Effects Developer Center.
Load and run scripts
When After Effects starts, it loads scripts from the Scripts folder. By default, the Scripts folder is in the following locations for After Effects:
(Windows) Program Files\Adobe\Adobe After Effects <version>\Support Files
(Mac OS) Applications/Adobe After Effects <version>
Scripts are also installed in user locations starting with After Effects CC 12.1.
Several scripts come with After Effects and are automatically installed in the Scripts folder.
Loaded scripts are available from the File > Scripts menu. If you edit a script while After Effects is running, you must save your changes for the changes to be applied. If you place a script in the Scripts folder while After Effects is running, you must restart After Effects for the script to appear in the Scripts menu, though you can immediately run the new script using the Run Script File command.
Scripts in the ScriptUI Panels folder are available from the bottom of the Window menu. If a script has been written to provide a user interface in a dockable panel, the script should be put in the ScriptUI folder. ScriptUI panels work much the same as the default panels in the After Effects user interface.
By default scripts are not allowed to write files or send or receive communication over a network. To allow scripts to write files and communicate over a network, select Edit > Preferences >_ Scripting & Expressions_ (Windows) or After Effects > Preferences > Scripting & Expressions (Mac OS), and select the Allow Scripts To Write Files And Access Network option.
To run a loaded script, choose File > Scripts > [script name].
To run a script that has not been loaded, choose File > Scripts > Run Script File, locate and select a script, and click Open.
To stop a running script, press Esc.
To run a script from the command line, call afterfx.exe from the command line. Use the -r switch and the full path of the script to run as arguments. This command does not open a new instance of the After Effects application; it runs the script in the existing instance.
Example (for Windows):afterfx -r c:\script_path\example_script.jsx
You can use this command-line technique—together with the software that comes with a customizable keyboard—to bind the invocation of a script to a keyboard shortcut.
You can view the list of ten most recently run scripts in After Effects. To view the list, select File > Scripts > Recent Script Files.
To rerun any of the ten most recently run scripts, press Cmd+Option+Shift+D (macOS) or Ctrl+Alt+Shift+D (Win).
Jeff Almasol provides a script that creates a simple console panel. The console panel includes a text area in which you can enter ExtendScript commands to be evaluated. There is no capturing of errors or messages; this console is only a simple way of entering commands without having to create a script first.
On the AE Scripts website, Lloyd Alvarez offers a tip on how to run .jsxbin scripts if you don't have access to the Scripts or ScriptUI Panels folder.
Scripts included with After Effects
After Effects provides several prewritten scripts to assist you in performing common tasks, and to provide a basis for you to modify and create your own scripts.
Run the sample script Demo Palette.jsx to get an idea of what sorts of things you can do with scripts.
Write and modify scripts
You can write your own scripts for use in After Effects by using the script editor, which is part of the ExtendScript Toolkit. The ExtendScript Toolkit provides a convenient interface for creating, debugging, and testing your own scripts. Sometimes, all that you need to do is make a slight modification to an existing script to make it do what you want; such slight modifications can often be performed with little knowledge of computer programming and scripting languages.
See the After Effects scripting guide for more information.
To start the script editor, choose File > Scripts > Open Script Editor.
A tutorial on the AE Enhancers forum leads the reader step by step through the creation of a script.
David Torno provides a list of matchnames for After Effects scripts.
Motion Graphics templates scripting access
Scripts can add properties to the Essential Graphics panel and export a Motion Graphics template, using the following scripting methods:
- Property canAddToMotionGraphicsTemplate() method app.project.item(index).layer(index).propertySpec.canAddToMotionGraphicsTemplate(comp) Test whether or not the property can be added to the Essential Graphics panel for the specified composition. Returns true if the property can be added, false otherwise. If the property can not be added, it is either because it is not one of the supported property types or the property has already been added to that composition. After Effects presents a warning dialog.
Supported property types are:
- Numerical Slider (i.e., a single-value numerical property, such as Transform > Opacity or the Slider Control expression control effect)
- Source Text
The composition that you want to test adding the property to, compItem.
- Property addToMotionGraphicsTemplate() method app.project.item(index).layer(index).propertySpec.addToMotionGraphicsTemplate(comp) Add the property to the Essential Graphics panel for the specified composition. Returns true if the property is successfully added, false otherwise. If the property is not added, it is either because it is not one of the supported property types or the property has already been added to that composition. After Effects will present a warning dialog. Use the canAddToMotionGraphicsTemplate() method to test whether the property can be added to a Motion Graphics template.
The composition that you want to test adding the property to, compItem.
- CompItem motionGraphicsTemplateName attribute app.project.item(index).motionGraphicsTemplateName Read or write the name property in the Essential Graphics panel for the composition. The name in the Essential Graphics panel is used for the file name of an exported Motion Graphics template, for example My Template.mogrt. The following example sets the name for the active composition and then returns it as an alert:
app.project.activeItem.motionGraphicsTemplateName = "My Template";
- CompItem exportAsMotionGraphicsTemplate() method app.project.item(index).exportAsMotionGraphicsTemplate(doOverWriteFileIfExisting, file_path) Export the composition as a Motion Graphics template. Returns true if the Motion Graphics template is successfully exported, false otherwise. The name in the Essential Graphics panel is used for the file name of the Motion Graphics template for example, My Template.mogrt. Use the motionGraphicsTemplateName attribute to set the name. Optionally specify the path to the folder where the Motion Graphics template file is saved. If not specified, the file will be saved in the current user's Essential Graphics folder:
/Users//Library/Application Support/Adobe/Common/Essential Graphics/
If the project is changed since the last time it was saved, After Effects prompts the user to save the project. To avoid this, use the project save() method before exporting the Motion Graphics template.
Whether to overwrite an exsiting file of the same name, boolean. Required.
Path to the folder where the file will be saved. Optional.
- CompItem openInEssentialGraphics() method app.project.item(index).openInEssentialGraphics() Open the composition in the Essential Graphics panel.
Where to find additional useful scripts
Find scripts, projects, and other useful items on the Adobe Add-ons website.
Dan Ebberts provides scripting tutorials and useful scripts in the scripting section of his MotionScript website.
Lloyd Alvarez provides a collection of useful scripts on his After Effects Scripts website.
The AE Enhancers forum provides example scripts and useful information about scripting (as well as expressions and animation presets) in After Effects.
Dale Bradshaw provides scripts and tricks on his Creative Workflow Hacks website.
Christopher Green provides many useful scripts on his website.