Adobe 65009963 Scripting Manual page 9

After effects cs4
Table of Contents

Advertisement

Overview
Additionally, After Effects includes a JavaScript debugger. For more information on activating and using the
debugger, see the ExtendScript Toolkit documentation in the JavaScript Tools Guide.
More resources to learn scripting
Many resources exist for learning more about scripting that uses the ECMA standard.
The After Effects scripting engine supports the 3rd Edition of the ECMA-262 Standard, including its
notational and lexical conventions, types, objects, expressions, and statements.
For a complete listing of the keywords and operators included with ECMAScript, refer to ECMA-262.pdf,
available at
ww w. ecma -in t ern atio nal .o rg/pu blicatio ns/stan dard s/Ecm a-262 .ht m
Books that deal with JavaScript 1.2 are also useful for understanding how scripting works in After Effects. One
book that is something of a standard for JavaScript users is JavaScript: The Definitive Guide (O'Reilly) by David
Flanagan. Another very readable source is JavaScript: A Beginner's Guide (Osborne) by John Pollock. Both of
these texts contain information that pertains only to extensions of JavaScript for Internet browsers; however,
they also contain thorough descriptions of scripting fundamentals.
There are also books for using AppleScript and creating Windows command line scripts, each of which can be
used to send scripts to After Effects.
JavaScript variables
Scripting shares a global environment, so any script executed at startup can define variables and functions that
are available to all scripts. In all cases, variables and functions, once defined by running a script that contains
them, persist in subsequent scripts during a given After Effects session. Once the application is quit, all such
globally defined variables and functions are cleared. Scripters should be careful about giving variables in
scripts unique names, so that a script does not inadvertently reassign global variables intended to persist
throughout a session.
JavaScript keywords and statement syntax
Although it is not possible to provide an exhaustive resource describing usage of JavaScript, the following
tables provide an overview of keywords, statements, operators, precedence, and associativity.
The following table lists and describes all keywords and statements recognized by the After Effects scripting
engine.
Table 1
Keywords and Statement Syntax
Keyword/Statement
b r e a k
c o n t i n u e
c a s e
d e f au lt
d o.. .w hile
f al s e
f o r
f or. ..in
Description
Standard JavaScript; exit the currently executing loop.
Standard JavaScript; cease execution of the current loop iteration.
Label used in a
s w i tc h
statement.
Label used in a
s w i tc h
statement when a
Standard JavaScript construct. Similar to the
at the end of the loop.
Literal representing the boolean false value.
Standard JavaScript loop construct.
Standard JavaScript construct. Provides a way to easily loop through the properties of an object.
More resources to learn scripting
.
c a s e
label is not found.
w h il e
loop, except loop condition evaluation occurs
9
9

Advertisement

Table of Contents
loading

This manual is also suitable for:

Creative suite 3 after effects

Table of Contents