Adobe 65009963 Scripting Manual page 4

After effects cs4
Table of Contents

Advertisement

Overview
The heart of a scriptable application is the object model. When you use Adobe After Effects, you create
projects, compositions, and render-queue items along with all of the elements that they contain: footage,
images, solids, layers, masks, effects, and properties. Each of these items, in scripting terms, is an object. This
guide describes the JavaScript objects that have been defined for After Effects projects.
Much of what scripting can accomplish replicates what can be done via the After Effects user interface, so a
thorough knowledge of the application itself is also essential to understanding how to use this functionality.
The After Effects object model is composed of a project, items, compositions, layers, and render-queue items.
Each object has its own special attributes, and every object in an After Effects project has its own identity
(although not all are accessible to scripting). You should be familiar with the After Effects object model in
order to create scripts.
After Effects scripting is based on ECMAScript (or more specifically, the 3rd Edition of the ECMA-262
Standard). Further documentation on this standard can be found at www.ecma-international.org. To take full
advantage of what is possible with scripting you will also need an understanding of writing scripts at the
system level (for integration with AppleScript or the Terminal command line in Mac OS and command-line
scripts on Windows systems) and a background in how to work with JavaScript.
NOTE: JavaScript objects normally referred to as "properties" are consistently called "attributes" in this guide, to
avoid confusion with After Effects' own definition of a property (an animatable value of an effect, mask, or
transform within an individual layer).
Expressions
Although both After Effects expressions and the After Effects scripting interface use JavaScript and can access
individual layer properties, they are entirely distinct entities. Expressions cannot access information from
scripts (such as variables and functions), although a script can be written to create or edit an expression.
Because both expressions and scripting use JavaScript, familiarity with either one is helpful in understanding
the other.
Motion math
Motion math is no longer included in After Effects; its functionality has been superseded by scripting and
expressions. All mathematical and logical operators common to ECMAScript are available in scripting.
For example, with expressions it is possible to simulate the physics of a bouncing ball by applying mathe-
matical rules to a "ball" layer. But using scripting, you can create a whole user interface that allows a bouncing
ball and shadow layer to be animated using criteria entered by the user.
Editing scripts
After Effects includes a JavaScript editor. To start it, choose File > Scripts > Open Script Editor. This script
editor and debugger, called the ExtendScript Toolkit, provides a convenient interface for creating and testing
your own scripts.
You can use any text editor to create, edit, and save scripts, but it is recommended that you choose an appli-
cation that does not automatically add header information when saving files and that saves with Unicode
(UTF-8) encoding.
Windows applications that are useful for editing scripts include EM Editor or the built-in Notepad (be sure
to set Encoding within save options to UTF-8).
Mac OS applications that are useful for editing scripts include BBEdit or the built-in OS X TextEdit (be sure
to set the Save type in Preferences to Unicode [UTF-8]).
Editing scripts
4
4

Advertisement

Table of Contents
loading

This manual is also suitable for:

Creative suite 3 after effects

Table of Contents