A collection of helpful workflow scripts for After Effects that either run natively right from the After Effects menu or partner well with 3rd party tools from aescripts + aeplugins such as KBar3, Tool Launcher, Quick Menu 3.
I also have a free tool for After Effects called Atheneum which I personally use with this script collection.
To run a script natively in After Effects use File > Script > Run Script File...
and choose the script.
Tip
All scripts can be found within the source/scripts folder.
From the front page, click the green Code
button and then click Download ZIP.
From there, you can unzip the file and choose any script file you want.
From a script page, click the Download raw file
near the upper right of code window.
Add an adjustment layer above the currently selected layer to break the 3D space of After Effects. If no layers are selected the adjustment layer will be added at the top.
Add an additional animation controller to the layer for the selected property.
Add a background layer to the current composition that will stay centered and match
the width
and height
of the current composition no matter if it is resized or copy and pasted
to a new composition.
Add a camera and 3D null as a controller to the current composition.
Add a comment (or remove a comment) to all selected layers.
Add a 16x9 fuscia rectangle shape layer to act as a guide. Helpful with things like precomposed character rigs.
Add the Fill effect to all selected layers while cycling through red
, green
,
blue
, yellow
, magenta
, and cyan
.
Select a single folder in the Project panel and run this script to search through all nested subfolders and add all compositions to the Render Queue.
Add a composition marker at the out point of each layer in the composition.
Add a marker to each layer at the same time as the selected keyframe.
Add a marker to all selected layers with an optional comment.
Add Posterize Time
adjustment layer to the current composition. Default Frame Rate
will be half the current frame rate.
Add posterizeTime(fps)
expression to all selected properties. Default fps
will
be half the current frame rate and existing expressions will be preserved.
Add all selected properties to Essential Graphics Panel. If any properties belong to a native After Effects expression controller then use the effect name instead.
Angle Control
Checkbox Control
Color Control
Dropdown Menu Control
Layer Control
Point Control
Slider Control
Add all selected items in the Project Panel to a new folder.
Add a loop expression to all selected properties. Use the popup window to customize
the loop or press the Enter
key to use the defaults.
Loop Directions:
loopIn()
loopOut()
(default)
Loop Types:
cycle
(default)pingpong
offset
continue
Keyframes:
0
(default)X
Add text animation to the selected text layers using a text animator.
Use the popup window to set the Based On
value using familiar options from After Effects:
Characters
Characters Excluding Spaces
Words
Lines
Add a checkbox that controls the visibility, using opacity, for a selected layer.
Append new code to all selected properties that contain expressions.
Search through all layers in the current composition, find all Stroke Width properties, and apply an expression to maintain the stroke width visually despite any scale.
Create a new controller layer and add a Dropdown Control
. You can now toggle the
visibility of all layers in the current composition. This dropdown will also be added to the
Essential Graphics Panel for the current composition.
Calculate the difference between two keyframe values.
Caution
Currently this script only supports 1 dimensional properties.
Calculate the distance between any two layers.
Distance Types:
2D Distance
is the distance between two layers in composition space - the optical distance3D Distance
is the distance between two layers in world space - the literal distance
Calculation Combinations:
2D
and2D
will default to2D Distance
3D
and3D
will default to3D Distance
2D
and3D
will default to3D Distance
Hold the ALT key
to force any combination to calculate 2D Distance
.
Calculate and alert the amount of time, in frames instead of seconds, between the currently selected keyframe and the Current Time Indicator.
Center the composition in the Composition Panel. Hold the ALT
key or SHIFT
key
for other values.
Change the background color of the current composition and all nested compositions.
Change the duration of the current composition and all nested compositions using timecode.
Change the duration of the current composition and all nested compositions.
Change the frame rate of the current composition and all nested compositions.
Change the start frame of the current composition and all nested compositions.
Reset the Work Area of the current composition and all nested compositions to cover the full duration of the composition.
Clean out the Render Queue.
Remove unused items from any selected folders.
Clean up the Overlord source folder by removing all files that aren't imported into the current project. Folder detection in the project and on the file systems is all automatic.
Files are not truely deleted instead they are moved to a Deleted
folder on the desktop.
Run the script, select an SRT file, and automatically convert all subtitles into
After Effects Text Layers
with no styling applied just in and out point timing.
Copy all markers from the current composition to the currently selected layer including duration, comments, and labels.
Sister script to: Copy Layer Makers to Composition.jsx
Copy all markers from the currently selected layer to the current composition including duration, comments, and labels.
Sister script to: Copy Composition Markers To Layer.jsx
Add a Text Layer to the current composition for each line in the selected text file.
Cycle the composition background color between black
, gray
, and white
.
Duplicate the selected layer exactly like pressing CMD/CTRL + D
but move the new
layer directly below the selected layer instead of above it.
Enabled the Collapase Transformations
switch on all layers within the project.
Layers with a marker that has the exact text of Do Not Collapse Transformations
will be
ignored.
Enabled the Motion Blur
switch on all compositions and on all eligible layers
within the project.
Export path points for the select path property to a text file on the desktop.
Export all selected text layers to a single export.txt
text file on the desktop.
Essential Properties from a nested composition can not be directly added to the Essential Graphic Panel of the parent composition.
Instead, run this script to expose those Essential Properties by using an intermediate expression controller. Select a layer to add all properterties or select specific properties to add them.
This script does not currently support Dropdown Menu Control
.
Extend every layer to match the composition duration in every composition in the current project.
Convert a property to keyframes and remove any redundant keyframes.
Warning
While you can select multiple properties, running the Convert Expression To Keyframes
as it
is setup now only works on the first viable property. Assume one property at a time for now.
Find and report all active expressions in the current project. Useful in preparing compositions for Lottie.
Find all instances of a specific efffect in the current project. Add additional
effects to be checked to the MatchNames
object.
Append .value;
to the end of an expression recently set with the pickwhip.
Force the Composition Panel to refresh the current frame.
Disable all selected layers.
Increase the scale of all DuIK Pin layers in the current project.
Increment any version numbers found in the name of all compositions in the current project.
Invert selected keyframe values.
Reselect all layers stored in a previous selection state
in the current
composition.
Sister script to: Layer Selection Set.jsx
Store all currently selected layers as a selection state
within the current
composition.
Sister script to: Layer Selection Get.jsx
Lock all layers in all conmpositions in the current project.
Convert selected keyframes into hold keyframes.
I wrote this script because the Render Queue was being annoying, spitting out renders with issues, and I didn't have time to troubleshoot the problem.
Instead, simply set your Work Area
then run the script to select where the PNG Sequence should
be rendered.
Caution
I don't recommend using this script regulary. saveFrameToPng()
is officially undocumented and
was found via research. The whole function may disappear or even completely stop working. The
quality does not compare to using the Render Queue.
Match the in point of all selected layers to the layer directly below it.
Match the start time of all selected layers to the layer directly below it.
Merge all imported and selected items in a previously existing and matching folder.
Select the Position
property of a parametric Rectangle or Ellipse and apply an
expression to move the Anchor Point. This allows shapes to have their sizes change but remain
locked to one edge.
Use the popup window to choose which side to move the Anchor Point:
Top
Left
Bottom
Right
Multiply selected keyframe values by a provided value.
Parent the closest layer in the composition to each selected layer. Calculations done in 2D space. Typically used in conjunction with Newton by Motion Botique.
Connect the opacity of a layer to the opacity of the parent layer. Both opacity properties can be animated individually however the lowest opacity value will always be used.
Parent each selected layer to the layer directly below it.
Posterize all selected keyframes in a composition to be on 2s.
Caution
Currently this script does not respect easing, spatial interpolation, temporal interpolation, roving keyframes, labels, or anything else. Results will always be linear keyframes.
Posterize the start time of all layers in a composition to be on 2s.
Ensure that any layer active on the last from of the composition it's Out Point
extended one frame past the end. This removes a bug from Lottie exports.
Randomly shift the start time of all selected layers within a provided range.
Remove all proxies within the current project.
Remove redundant keyframes from the selected properties. Especially helpful for
reducing the amount of keyframes after using the Convert Expression to Keyframes
command.
Rename the composition to match the name of the project file.
Rename selected arm puppet pins in preparation for DuIK. Hold the ALT
key to
rename selected leg puppet pins.
Rename the source of the currently selected layer.
Rename the selected layers append letters as needed.
Rename the selected layers appending zero-padded numbers as needed.
Rename the selected layers appending each character and character count as needed.
Renames a selected layer to match the layer below and appending Matte
to the end.
Warning
This script doesn't detect actual Track Matte pairs. This script also assumes the timeline is set up using the old style of mattes where mattes were required to be directly above a layer.
Rename selected project items appending zero-padded numbers as needed.
Rename the selected item to match the name of the layer it is used for.
Replace the selected Grid Rig Control
null layer created by Flex by Zack Lovatt
with a shape layer. This script assumes default and un-keyframed values.
Replace text in the name of all selected project items. RegEx is accepted.
Set the Work Area to cover the entire composition.
Reset the name for all layers in the current composition.
Round the values for all selected keyframes to the nearest whole number. Currently supports basic properties with 1, 2, or 3 dimensions.
Round the values for all selected properties to the nearest whole number. Currently supports basic properties with 1, 2, or 3 dimensions.
Save the current frame as a PNG to the default save location. Output will match the following format:
Composition Name YYYY-MM-DD HH.MM.SS AM.png
When first running the script, you will be prompted for a save location. That location will be
used for all future saves. If you want to set a new location, hold the SHIFT
key.
Select any unlocked layer parented to the selected layer in the current composition.
Select any unlocked layer in the current composition that is disabled.
Select all layers in the current composition that are Guide Layers.
Select all layers in the current composition that are directly below a layer with
the label color 16
. In my preferences label 16 is Black #000000
and is always used for track
mattes.
Select any unlocked layer in the current composition not created as a null object.
Select the parent of the currently selected layer.
Randomly select any unlocked layer in the current composition.
Select all Text Layers
in the current composition.
Select any unlocked layer in the current composition without a parent.
Separate the size dimensions for a parametric rectangle or ellipse by adding a
slider for both X Size
and Y Size
to the layer.
Set the label for all items in the current project to None
or label 0
.
Set the label for all layers in the current composition to None
or label 0
.
Set the label color for all track matte layers in the active composition to 16
. In
my preferences label 16 is Black #000000
and is always used for track mattes.
Select a color property and set a new color based on the original color, blend mode, and opacity. Colors are calculated using the After Effects order of operations. Supports the following blend modes:
Multiply
Screen
Set proxies for all compositions within the project.
Automatically enable Time Remapping, set the appropriate keyframes, and apply the
loopOut()
expression to correctly loop a layer.
Set the last selected layer to the average position of all other layers. Hold the
ALT
key to set the first selected layer.
Set the track matte for all selected layers to the layer above it.
TrackMatteType.ALPHA
TrackMatteType.ALPHA_INVERTED
TrackMatteType.LUMA
TrackMatteType.LUMA_INVERTED
TrackMatteType.NO_TRACK_MATTE
Shift the start of a group of selected layers to the current time while maintaining relative timing within the group.
Help effects with position properties such as CC Bend It
or Gradient Ramp
stick
properly to a layer.
Swap the values of two selected properties with the same property type.
Swap the dimension values for all selected properties. For example, swap the x and y size values for a rectangle shape layer.
Toggle the blend mode of the selected layers to Difference
. Hold the ALT
key to
toggle back to Normal
.
Toggle an expression that maintains visual scale for layer regardless of Z position.
Toggle onion skinning in the current composition using CC Wide Time
.
Cause every composition within the current project to maintain nested frame rate.
Corresponds to the value of the Preserve frame rate when nested or in render queue
option in
the Advanced
tab of the Composition Settings
dialog box. Hold the ALT
key to toggle this
preference off.
Toggle the On Transparent
checkbox for every instance of the Puppet
effect in
the current project. This eliminates situations where the Expansion
didn't quite grab every
pixel for the underlying layer and leaves an extra little snippet.
Toggle the types of selected puppet pins between Position
and Advanced
.
Set all DuIK Pin layers to visible. Hold the ALT
key to set to guide layers.
Disable all specified effects in the current project. Hold the ALT
key to enable.
Add additional effects to be checked to the MatchNames
object.
Toggle timecode between two different values:
- Timecode starts at
0:00:00:00
and composition frames start on0
- Timecode starts at
0:00:00:00
and composition frames start on1
Copy the Work Area from the current composition. Hold the ALT
key to paste a
copied Work Area to the current composition.
Unlock all layers in all conmpositions in the current project.
Find an replace all instances of a specific expression with a new expression.
Zero out the position of all selected layers.