Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The After Effects Scripting Guide demonstrates how to take procedural control of your After Effects projects via
scripting. This feature set is available in Adobe® After Effects® CS3 Professional Edition.
With the use of system-level scripting, you can streamline your render pipeline and avoid a lot of repetitive
pointing and clicking. If you have used expressions or other JavaScript-like techniques for animating, or
worked with system scripting in AppleScript or Visual Basic, you will recognize the power of application
scripting in After Effects. With some practice, and with sufficient experience using the JavaScript language, you
can take control of your graphics pipeline.
3
Overview Editing scripts
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]).
4
Overview Activating full scripting features
5
Overview Accessing and writing scripts
Adobe supplies a full-featured JavaScript debugger, called the ExtendScript Toolkit. The Toolkit is disabled by
default so that casual users do not encounter it. When editing or writing scripts, the Toolkit can help you
diagnose script problems more quickly. To activate the Toolkit on the local computer when a script error is
encountered, choose Preferences > General, and select Enable JavaScript Debugger. For detailed information
on the ExtendScript Toolkit, see the JavaScript Tools Guide.
Note that the Toolkit operates only when executing a script, not with expressions, even though expressions
also make use of JavaScript.
6
Overview Sending a script to After Effects from the system
If your script creates its user interface in a function, you cannot use "this" as it will refer to the function itself,
not the panel. In this case, you should pass the "this" object as an argument to your function. For example:
f u n c t io n c r e a teU I ( th is O b j) {
va r myPane l = t hisO b j;
myPane l.add("bu tt on", [10 , 10, 100 , 30 ], "T ool #1 ") ;
return myPanel;
}
v a r m y T o o l s P a n e l = c r e at e U I ( t h i s ) ;
myToolsPanel.show();
You cannot use the File > Scripts > Run Script File menu command to run a script that refers to "this". To
make your script work with either a Window object (accessible from the File > Scripts menu) or a native panel
(accessible from the Window menu), check whether "this" is a Panel object. For example:
f u n c t io n c r e a teU I ( th is O b j) {
v a r m y P an e l = ( th is O b j i n st an c e o f P a n e l ) ? t h i s O b j : n e w W i n d o w ( " p a l e t t e " , " M y T o o l s " ,
[100 , 10 0, 3 00, 3 00]);
myPane l.add("bu tt on", [10 , 10, 100 , 30 ], "T ool #1 ") ;
return myPanel;
}
v a r m y T o o l s P a n e l = c r e at e U I ( t h i s ) ;
myToolsPanel.show();
7
Overview Testing and troubleshooting
Alternatively, you can specify the location of the JSX file to be executed. For example:
a ft er f x . e x e -r c : \ m y D o c u m e n t s \ Sc r i p t s \ y o u r AE S criptH ere. jsx
a f t e r f x . e x e -r " c : \ m y D o c u m e n t s \ Sc r i p ts \ S c r i pt N am e w it h S p ac e s .j sx "
Alternatively, you could display a dialog box asking for the location of the JSX file to be executed, as follows:
s et the F i le to c h oos e f i le
t el l ap p l ic a ti on "A dob e Af ter Eff ec t s C S3 "
D oS c ri pt th eF i l e
en d t ell
Finally, this script is perhaps most useful when you are working directly on editing a JSX script and want to
send it to After Effects for testing or to run. To use it effectively you must enter the application that contains
the open JSX file (in this example it is TextEdit); if you do not know the proper name of the application, type
in your best guess to replace “TextEdit” and AppleScript prompts you to locate it.
Simply highlight the script text that you want to run, and then activate this AppleScript:
(*
T h i s s c r i p t s e n d s t he c u r r e n t s e l e c t i o n t o A ft er E f f e c t s a s a s c r i p t .
*)
t e l l ap p l ic a ti o n " T e xt E d i t"
s e t the _ sc r ip t to s e l e c t i o n as te x t
en d t ell
For more information on using AppleScript, check out Matt Neuberg’s AppleScript: the Definitive Guide
(O’Reilly & Associates) or Sal Soghoian’s AppleScript 1-2-3 (Peachpit Press).
8
Overview More resources to learn scripting
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.
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.
d o.. .w hile Standard JavaScript construct. Similar to the w h il e loop, except loop condition evaluation occurs
at the end of the loop.
f or. ..in Standard JavaScript construct. Provides a way to easily loop through the properties of an object.
9
Overview More resources to learn scripting
10
Keyword/Statement Description
n u ll Assigned to a variable, array element, or object property to indicate that it does not contain a legal
value.
s wi t c h Standard JavaScript way of evaluating a JavaScript expression and attempting to match the expres-
sion’s value to a c a se label.
un de fined Indicates that the variable, array element, or object property has not yet been assigned a value.
w hi l e Standard JavaScript construct. Similar to the d o.. .w hile loop, except loop condition evaluation
occurs at the beginning of the loop.
JavaScript operators
The following tables list and describe all operators recognized by the After Effects scripting engine and show
the precedence and associativity for all operators.
. Structure member.
[] Array element.
() Function call.
++ Pre- or post-increment.
–– Pre- or post-decrement.
~ Bitwise NOT.
! Logical NOT.
* Multiply.
/ Divide.
% Modulo division.
10
Overview More resources to learn scripting
11
Operators Description
+ Add.
== Equal.
!= Not equal.
^ Bitwise XOR.
| Bitwise OR.
|| Logical OR.
?: Conditional (ternary).
= Assignment.
, Multiple evaluation.
[ ], () , . left to right
11
Overview More resources to learn scripting
12
*, /, % left to right
= =, != left to right
^ left to right
| left to right
|| left to right
?: right to left
, left to right
12
JavaScript Reference
This chapter lists and describes JavaScript classes, objects, methods, attributes, and global functions defined by
After Effects.
The After Effects scripting engine supports ExtendScript, Adobe’s extended version of JavaScript, which imple-
ments 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 ECM A-262 .pdf , available at ww w. ecm a-inte r natio n al. org/p ublicatio n s/stan d ards/
E c m a - 2 6 2 . h t m. For an overview of the most common keywords and statements available from ECMA-262,
see “JavaScript keywords and statement syntax” on page 9.
RENDER1UEUE ITEMS
LAYERS ITEMS
PROXY3OURCE MAIN3OURCE PROXY3OURCE
RENDER1UEUE)TEMS
PROPERTIES MAIN3OURCE PROXY3OURCE
MAY BE ANY OF THE FOLLOWING TYPES OF ITEM
OUTPUT-ODULES
SOLID3OURCE /2 PLACEHOLDER3OURCE /2 FILE3OURCE
COLOR FILE
Note that the File, Folder, and Socket objects are defined by ExtendScript, and are documented in the JavaS-
cript Tools Guide. ExtendScript also defines the ScriptUI module, a set of window and user-interface control
objects, which are available to After Effects scripts. These are also documented in the JavaScript Tools Guide.
The hierarchy of objects in scripting corresponds to the hierarchy in the user interface.
13
JavaScript Reference The After Effects Object Model
14
The application contains a Project panel, which displays a project. The project contains compositions, which
contain layers. The source for a layer can be a footage file, placeholder, or solid, also listed in the Project panel.
Each layer contains settings known as properties, and these can contain markers and keyframes. The render
queue contains render-queue items as well as render settings and output modules. All of these entities are repre-
sented by objects in scripting.
NOTE: To avoid ambiguity, this manual uses the term “attribute” to refer to JavaScript object properties, and the
term “property” or “AE property” to refer to After-Effects layer properties.
Object summary
The following table lists all objects alphabetically, with links to the documentation page for each.
Object Description
“Global functions” on page 16 Globally available functions that allow you to display text for script debugging purposes,
and help convert time values between seconds and frames.
“Application object” on page 19 A single global object, available by its name (ap p ), that provides access to objects and
application settings within the After Effects application.
“AVItem object” on page 32 Represents audio/visual files imported into After Effects.
“AVLayer object” on page 39 Represents those layers that contain AVItem objects (Comp layers, footage layers, solid
layers, text layers, and sound layers).
“Collection object” on page 51 Associates a set of objects or values as a logical group and provides access to them by
index.
“CompItem object” on page 52 Represents a composition, and allows you to manipulate it and get information about it.
14
JavaScript Reference The After Effects Object Model
15
Object Description
“FootageItem object” on page 64 Represents a footage item imported into a project, which appears in the Project panel.
“ImportOptions object” on page 73 Encapsulates options for importing files into After Effects.
“Item object” on page 76 Represents an item in a project that appears in the Project panel.
“KeyframeEase object” on page 81 Encapsulates keyframe ease values in an After Effects property.
“OutputModule object” on page 105 Represents an output module for a render queue.
“PropertyBase object” on page 140 A base class for After Effects property and property group classes.
“RenderQueue object” on page 152 Represents the After Effects render queue.
“RQItemCollection object” on page 161 Provides access to application settings and preferences.
“Shape object” on page 164 Encapsulates the outline shape information for a mask.
“SolidSource object” on page 168 Describes a solid color that is the source of some footage.
“System object” on page 169 Provides access to the operating system from the application.
15
JavaScript Reference Global functions
16
Global functions
These globally available functions that are specific to After Effects. Any JavaScript object or function can call
these functions, which allow you to display text in a small (3-line) area of the Info panel, and to convert
numeric time values to and from string values.
cur rent F orma tTo T im e() Converts string time value to a numeric time value.
t im eToCu rren tForm at () Converts a numeric time value to a string time value.
writeLn() Writes text to the Info panel, adding a line break at the end.
Additional global functions for standard user I/O (ale rt , c o n f ir m , and p r o m pt ) and static functions for file
I/O, are defined by ExtendScript; for detailed reference information, see the Adobe Bridge® JavaScript
Reference.
NOTE: The After Effects global functions for standard dialogs and file I/O are still supported in this release, but
are deprecated and will not be supported in future releases. For details, see the After Effects 6.5 documentation.
Description
Parameters
None.
Returns
Nothing.
Description
Converts a formatted string for a frame time value to a number of seconds, given a specified frame rate. For
example, if the formatted frame time value is 0:00:12 (the exact string format is determined by a project
setting), and the frame rate is 24 fps, the time would be 0.5 seconds (12/24). If the frame rate is 30 fps, the time
would be 0.4 seconds (12/30).
If the time is a duration, the frames are counted from 0. Otherwise, the frames are counted from the project’s
starting frame (see “Project displayStartFrame attribute” on page 111).
Parameters
f o r m a tt e d T i m e The frame time value, a string specifying a number of frames in the project’s current time display format.
16
JavaScript Reference Global functions
17
i s D u r a t io n Optional. When true, the time is a duration (measured from frame 0). When false (the default), the time is
measured from the project’s starting frame.
Returns
Description
Converts a numeric time value (a number of seconds) to a frame time value; that is, a formatted string that
shows which frame corresponds to that time, at the specified rate. For example, if the time is 0.5 seconds, and
the frame rate is 24 fps, the frame would be 0:00:12 (when the project is set to Display Timecode). If the frame
rate is 30 fps, the frame would be 0:00:15. The format of the timecode string is determined by a project setting.
If the time is a duration, the frames are counted from 0. Otherwise, the frames are counted from the project’s
starting frame (see “Project displayStartFrame attribute” on page 111).
Parameters
i s D u r a t io n Optional. When true, the time is a duration (measured from frame 0). When false (the default), the time is
measured from the project’s starting frame.
Returns
Description
Parameters
t ex t The string to display. Truncated if too long for the Info panel.
Returns
Nothing.
Example
w r i te (" T h i s t e x t a pp e a rs i n I n fo pa n e l " ) ;
w r i t e (" w i t h m o r e o n s a m e l i n e . " ) ;
17
JavaScript Reference Global functions
18
Description
Writes output to the Info panel and adds a line break at the end.
Parameters
Returns
Nothing.
Example
w r i te l n (" T h i s t e x t a pp ea rs on f ir st l i n e" ) ;
w r i te l n (" T h i s t e x t a pp ea r s o n s e c o n d l i n e " ) ;
18
JavaScript Reference Application object
19
Application object
a pp
Description
Provides access to objects and application settings within the After Effects application. The single global object
is always available by its name, ap p .
Attributes of the Application object provide access to specific objects within After Effects. Methods of the
Application object can create a project, open an existing project, control Watch Folder mode, purge memory,
and quit the After Effects application. When the After Effects application quits, it closes the open project,
prompting the user to save or discard changes as necessary, and creates a project file as necessary.
Attributes
language “Application language attribute” on The language in which the application is running.
page 24
ve rsio n “Application version attribute” on The version number of the After Effects application.
page 30
buildName “Application buildName attribute” on The name of this build of the application.
page 21
buildNumber “Application buildNumber attribute” on The number of this build of the application.
page 22
isWatchFolder “Application isWatchFolder attribute” When true, the local application is running in Watch
on page 24 Folder mode.
isRenderEngine “Application isRenderEngine attribute” When true, the local After Effects application is running
on page 24 as a render engine.
s e t ti n g s “Application settings attribute” on Application settings that can be set via scripting.
page 30 and “RQItemCollection object”
on page 161
onE rror “Application onError attribute” on A callback function that is called when an error occurs
page 26 in the application.
exitCode “Application exitCode attribute” on A numeric status code used when executing a script
page 24 externally (that is, from a command line or AppleScript).
0 if no error occurred. A positive number indicates an
error that occurred while running the script.
e x i t A f ter L a u n ch A n d E v a l “Application exitAfterLaunchAndEval When true, the application remains open after running
attribute” on page 23 a script from the command line on Windows.
s ave Pr oje ct O nCra sh “Application saveProjectOnCrash When true, the project is saved if the application closes
attribute” on page 28 unexpectedly.
19
JavaScript Reference Application object
20
Methods
open() “Application open() method” on page 26 Opens a project or an Open Project dialog box.
w at c hF o l d er ( ) “Application watchFolder() method” on Starts Watch Folder mode; does not return
page 30 until Watch Folder mode is turned off.
b e g in U n d o G r o u p( ) “Application beginUndoGroup() method” Groups the actions that follow it into a single
on page 21 undoable step.
endUndoGroup() “Application endUndoGroup() method” on Ends an undo group; needed only when a
page 22 script contains more than one undo group.
set Sa vePre fe rencesO n Qu it () “Application setSavePreferencesOnQuit() Sets whether preferences are saved when the
method” on page 29 application is quit.
a ct i vat e( ) “Application activate() method” on page 20 Brings the After Effects main window to the
front of the screen.
Description
Opens the application main window if it is minimized or iconified, and brings it to the front of the desktop.
Parameters
None.
20
JavaScript Reference Application object
21
Returns
Nothing.
Description
Begins suppression of script error dialog boxes in the user interface. Use endSuppr essD ialogs() to resume the
display of error dialogs. See “Application endSuppressDialogs() method” on page 22.
Parameters
None.
Returns
Nothing.
Description
Marks the beginning of an undo group, which allows a script to logically group all of its actions as a single
undoable action (for use with the Edit > Undo/Redo menu items). Use the e n d U n d o G r o u p ( ) method to mark
the end of the group. (See “Application endUndoGroup() method” on page 22.)
b e g in U n d o G r o u p( ) and e n d U n d o G r o u p ( ) pairs can be nested. Groups within groups become part of the
larger group, and will undo correctly. In this case, the names of inner groups are ignored.
Parameters
undoString The text that will appear for the Undo command in the Edit menu (that is, “Undo <u nd oS tri n g> ”)
Returns
Nothing.
Description
The name of the build of After Effects being run, used internally by Adobe for testing and troubleshooting.
Type
String; read-only.
21
JavaScript Reference Application object
22
Description
The number of the build of After Effects being run, used internally by Adobe for testing and troubleshooting.
Type
Integer; read-only.
Description
Removes the specified task from the queue of tasks scheduled for delayed execution.
Parameters
Returns
Nothing.
Description
Ends the suppression of script error dialog boxes in the user interface. Error dialogs are displayed by default;
call this method only if b e g i n S u p p r e s s Di al o g s ( ) has previously been called. See “Application beginSuppress-
Dialogs() method” on page 21.
Parameters
a l ert Boolean; when true, errors that have occurred following the call to b e g i n S u p p r e ss D ia l o g s ( ) are displayed in a
dialog box.
Returns
Nothing.
Description
Marks the end of an undo group begun with the a p p . b e g i n U n d o Gr ou p ( ) method. You can use this method
to place an end to an undo group in the middle of a script, should you wish to use more than one undo group
for a single script.
If you are using only a single undo group for a given script, you do not need to use this method; in its absence
at the end of a script, the system will close the undo group automatically.
22
JavaScript Reference Application object
23
Parameters
None.
Returns
Nothing.
Description
Parameters
None
Returns
Nothing.
See also
Description
This attribute is used only when executing a script from a command line on Windows. When the application
is launched from the command line, the – r or – s command line flag causes the application to run a script
(from a file or from a string, respectively).
If this attribute is set to true, After Effects will exit after the script is run; if it is false, the application will remain
open.
This attribute only has an effect when After Effects is run from the Windows command line. It has no effect
in Mac OS.
Type
Boolean; read/write.
23
JavaScript Reference Application object
24
Description
A numeric status code used when executing a script externally (that is, from a command line or AppleScript).
• In Windows, the value is returned on the command line when After Effects was launched on the commands
line (using the af te rf x or a f t er f x – m command), and a script was specified with the – r or – s option.
• in Mac OS, the value is returned as the AppleScript D oS cr ip t result for each script.
In both Mac OS and Windows, the value is set to 0 (E X I T _ S U C C E S S ) at the beginning of each script evalu-
ation. In the event of an error while the script is running, the script can set this to a positive integer that
indicates what error occurred.
Type
Integer; read/write.
Example
a pp . e xi t C o d e = 2 ; / / o n qui t , i f v alue is 2, an er ror h as occurr ed
Description
Type
Boolean; read-only.
Description
True if the Watch Folder dialog box is currently displayed and the application is currently watching a folder
for rendering.
Type
Boolean; read-only.
Description
Type
24
JavaScript Reference Application object
25
L a n g u a g e . E N GL I SH
Language.FRENCH
Language.GERMAN
L a n g u a g e . I T AL I A N
Language.JAPANESE
Language.SPANISH
Example
v a r l a n g = a pp . l a n g u a g e ;
if (lang == Language.ENGLISH)
a l e r t (" A f t e r E f f e c ts i s r u n n i n g i n E n g l i s h . " ) ;
e l s e i f ( l a n g = = L a n g u a g e. F R E N C H )
a l e r t (" A f t e r E f f e c t s i s r un n i n g i n F r e n c h . " ) ;
else
a l e r t (" A f t e r E f f e c ts i s n o t r u n n i n g i n E n g l i s h o r F r e n c h . " ) ;
Description
Type
Number; read-only.
Description
Creates a new project in After Effects, replicating the File > New > New Project menu command.
If the current project has been edited, the user is prompted to save it. If the user cancels out of the Save dialog
box, the new project is not created and the method returns null. Use a pp . p r o je c t .c l o s e ( C l o s e O p -
t io n s. D O _ N O T _ SA VE _ C H A N G E S ) to close the current project before opening a new one. See “Project
close() method” on page 111.
Parameters
None.
Returns
Example
a pp . p r o j e c t . c l o s e ( C l o s e Op t io n s . D O _ N O T _ S A V E _ C H A N G E S ) ;
a pp .n e wP ro jec t () ;
25
JavaScript Reference Application object
26
Description
The name of a callback function that is called when an error occurs. By creating a function and assigning it to
this attribute, you can respond to errors systematically; for example, you can close and restart the application,
noting the error in a log file if it occurred during rendering. See “RenderQueue render() method” on
page 153.
The callback function is passed the error string and a severity string. It should not return any value.
Type
Example
f u n c t io n e r r ( e r r S t r i n g ) {
a l ert (e rrStr ing);
}
a pp.o n Erro r = e rr;
Description
Opens a project.
Parameters
file Optional. An ExtendScript File object for the project file to open. If not supplied, the method prompts the
user to select a project file.
Returns
A new Project object for the specified project, or null if the user cancels the Open dialog box.
Example
v a r m y _ f il e = n e w F i l e ( " . . /m y _ fol d e r / m y _ t e s t . a e p" ) ;
i f (m y _ f i l e . e x i s ts ) {
n e w_ p r o j e c t = ap p .o p e n ( m y _ f il e );
i f (n e w_ p r o j e c t) {
a l ert (ne w_proj ect. file. n ame );
}
}
26
JavaScript Reference Application object
27
Description
Loads color swatch data from an Adobe Swatch Exchange (ASE) file.
Parameters
Returns
d at a. v al u e s An array of S wa tc h V al u e .
0.0 is Black.
Description
Pauses or resumes the search of the target watch folder for items to render.
Parameters
Returns
Nothing.
27
JavaScript Reference Application object
28
See also
Description
The project that is currently loaded. See “Project object” on page 109.
Type
Description
Purges unused data of the specified types from memory. Replicates the Purge options in the Edit menu.
Parameters
t arg e t The type of elements to purge from memory; a Pu rgeTa rget enumerated value, one of:
• P u r g e T a r g e t . A L L _ C A C H E S : Purges all data that After Effects has cached to physical memory.
• Pur g eTa rget .U N DO _ C ACH E S : Purges all data saved in the undo cache.
• Pur g e T a r g e t . S N A P S HO T _ C A C HE S : Purges all data cached as comp/layer snapshots.
• P u r g e T a r g e t . I M A G E _ C A C H E S : Purges all saved image data.
Returns
Nothing.
Description
Parameters
None.
Returns
Nothing.
28
JavaScript Reference Application object
29
Description
When true (the default), After Effects attempts to display a dialog box that allows you to save the current
project if an error causes the application to quit unexpectedly. Set to false to suppress this dialog box and quit
without saving.
Type
Boolean; read/write.
Description
Parameters
delay A number of milliseconds to wait before executing the JavaScript. A floating-point value.
re pe at When true, execute the script repeatedly, with the specified delay between each execution. When false
the script is executed only once.
Returns
Integer, a unique identifier for this task, which can be used to cancel it with a p p. c anc el Ta sk ( ) .
Description
Sets memory usage limits as in the Memory & Cache preferences area. For both values, if installed RAM is less
than a given amount (n gigabytes), the value is a percentage of the installed RAM, and is otherwise a
percentage of n. The value of n is: 2 Gb for Win32, 4 Gb for Win64, 3.5 Gb for Mac OS.
Parameters
Returns
Nothing.
Description
Set or clears the flag that determines whether preferences are saved when the application is closed.
29
JavaScript Reference Application object
30
Parameters
d o S av e When true, preferences saved on quit, when false they are not.
Returns
Nothing.
Description
Type
Description
Type
String; read-only.
Example
v a r v e r = a pp . v e r s i o n ;
a l e r t ( " T h is m a c h i n e i s r un n i n g v e r s io n " + v e r + " o f A ft e r E f f e c t s . " ) ;
Description
Parameters
Returns
Nothing.
Example
var theFolder = new Folder(“c:/tool”);
a pp .w at c h F o l d e r (t h e F o ld e r );
30
JavaScript Reference Application object
31
See also
31
JavaScript Reference AVItem object
32
AVItem object
a pp .p r o j e c t .i te m (i nd e x)
Description
The AVitem object provides access to attributes and methods of audio/visual files imported into After Effects.
• AVItem is a subclass of Item. All methods and attributes of Item, in addition to those listed below, are
available when working with AVItem. See “Item object” on page 76.
• AVItem is the base class for both CompItem and FootageItem, so AVItem attributes and methods are also
available when working with CompItem and FootageItem objects. See “CompItem object” on page 52 and
“FootageItem object” on page 64.
Attributes
name “AVItem name attribute” on page 35 The name of the object as shown in the Project panel.
p i xe l A s pe c t “AVItem pixelAspect attribute” on page 35 The pixel aspect ratio of the item.
f ram eDu rat ion “AVItem frameDuration attribute” on page 33 The frame duration for the item.
usePro xy “AVItem useProxy attribute” on page 38 When true, a proxy source is used for this item.
proxySource “AVItem proxySource attribute” on page 35 The FootageItem object used as proxy for the item.
usedIn “AVItem usedIn attribute” on page 38 The CompItem objects that use this item.
h as Vi de o “AVItem hasVideo attribute” on page 34 When true, the item has a video component.
h as Aud i o “AVItem hasAudio attribute” on page 34 When true, the item has an audio component.
f o o t a g e Mi s s i n g “AVItem footageMissing attribute” on When true, the item cannot be found or is a placeholder.
page 33
Methods
s et Pr o x y W it hS eq ue n c e() “AVItem setProxyWithSequence() method” on Sets a sequence as a proxy for the item.
page 37
s etP rox yWi thP l acehold er() “AVItem setProxyWithPlaceholder() method” on Sets a placeholder as a proxy for the item.
page 36
s e t Pr o x y T o N o n e () “AVItem setProxyToNone() method” on page 36 Removes the proxy for the item.
32
JavaScript Reference AVItem object
33
Description
Returns the duration, in seconds, of the item. Still footage items have a duration of 0.
• In a CompItem, the value is linked to the d u r a ti o n of the composition, and is read/write.
• In a FootageItem, the value is linked to the du rat i on of the m a i n So u r c e object, and is read-only.
Type
Floating-point value in the range [0.0..10800.0]; read/write for a CompItem; otherwise, read-only.
Description
When true, the AVItem is a placeholder, or represents footage with a source file that cannot be found. In this
case, the path of the missing source file is in the m i s s i n g F o ot a g e P a t h attribute of the footage item’s source-file
object. See “FootageItem mainSource attribute” on page 65 and “FileSource missingFootagePath attribute”
on page 60.
Type
Boolean; read-only.
Description
Returns the length of a frame for this AVItem, in seconds. This is the reciprocal of f ra m eRa te . When set, the
reciprocal is automatically set as a new f r am e R a te value.
This attribute returns the reciprocal of the f r am e R a te , which may not be identical to a value you set, if that
value is not evenly divisible into 1.0 (for example, 0.3). Due to numerical limitations, (1 / (1 / 0.3)) is close to,
but not exactly, 0.3.
If the AVItem is a FootageItem, this value is linked to the m a i n S o u r ce , and is read-only. To change it, set the
c o n f o r m F r a m e R a t e of the m ai n S ourc e object. This sets both the f rame Rat e and fr ame Dur at io n of the
FootageItem.
Type
Floating-point value in the range [1/99.. 1.0]; read-only for a FootageItem, otherwise read/write.
33
JavaScript Reference AVItem object
34
Description
The frame rate of the AVItem, in frames-per-second. This is the reciprocal of the f rame Dur at io n . When set,
the reciprocal is automatically set as a new f ram eDu rat ion value.
• In a CompItem, the value is linked to the f r am e R a te of the composition, and is read/write.
• In a FootageItem, the value is linked to the fr ame Rat e of the m a i n S o u r c e object, and is read-only. To change
it, set the c o n f o r m F r am e R a t e of the m ai n S ourc e object. This sets both the f ra m eRa te and f r a m e D u r a ti o n
of the FootageItem.
Type
Floating-point value in the range [1.0..99.0]; read-only for a FootageItem, otherwise read/write.
Description
Type
Boolean; read-only.
Description
Type
Boolean; read-only.
Description
34
JavaScript Reference AVItem object
35
• In a FootageItem, the value is linked to the m a i n S o u r c e object, and is read/write only if the m a i n So u r c e
object is a SolidSource. Otherwise, it is read-only.
Type
Description
Type
String; read/write.
Description
Type
Description
The FootageSource being used as a proxy. The attribute is read-only; to change it, call any of the AVItem
methods that change the proxy source: se tP rox y ( ) , s et P rox y Wi th Se qu ence( ) , se tP rox y Wi t hS ol i d( ) , or
s et Pr o x y W it hP l ac e ho l d er( ) .
Type
35
JavaScript Reference AVItem object
36
Description
Sets a file as the proxy of this AVItem. Loads the specified file into a new FileSource object, sets this as the value
of the p r o x y S o u r c e attribute, and sets u s e P r o x y to true. It does not preserve the interpretation parameters,
instead using the user preferences. If the file has an unlabeled alpha channel, and the user preference says to
ask the user what to do, the method estimates the alpha interpretation, rather than asking the user.
This differs from setting a FootageItem's main source, but both actions are performed as in the user interface.
Parameters
Returns
None.
Description
Removes the proxy from this AVItem, sets the value of p r o xy S o u r c e to null, and sets the value of u se Pr ox y to
f al s e .
Parameters
None.
Returns
Nothing.
Description
Creates a PlaceholderSource object with specified values, sets this as the value of the p r o xy S o u r c e attribute,
and sets u se Pr ox y to true. It does not preserve the interpretation parameters, instead using the user prefer-
ences.
NOTE: There is no direct way to set a placeholder as a proxy in the user interface; this behavior occurs when a proxy
has been set and then moved or deleted.
Parameters
w i dt h, h eight The pixel dimensions of the placeholder, an integer in the range [4..30000].
36
JavaScript Reference AVItem object
37
Returns
Nothing.
Description
Sets a sequence of files as the proxy of this AVItem, with the option of forcing alphabetical order. Loads the
specified file sequence into a new FileSource object, sets this as the value of the pr ox y So urc e attribute, and sets
usePro xy to true. It does not preserve the interpretation parameters, instead using the user preferences. If any
file has an unlabeled alpha channel, and the user preference says to ask the user what to do, the method
estimates the alpha interpretation, rather than asking the user.
Parameters
file An ExtendScript File object for the first file in the sequence.
Returns
Nothing.
Description
Creates a SolidSource object with specified values, sets this as the value of the p r o xy S o u r c e attribute, and sets
usePro xy to true. It does not preserve the interpretation parameters, instead using the user preferences.
NOTE: There is no way, using the user interface, to set a solid as a proxy; this feature is available only through
scripting.
Parameters
color The color of the solid, an array of 3 floating-point values, [R, G, B], in the range [0.0..1.0].
w i dt h, h eight The pixel dimensions of the placeholder, an integer in the range [1...30000].
p i xe l A s pe c t The pixel aspect of the solid, a floating-point value in the range [0.01... 100.0].
Returns
Nothing.
37
JavaScript Reference AVItem object
38
Description
The current time of the item when it is being previewed directly from the Project panel. This value is a number
of seconds. Use the global method t im eToCu rren tForm at to convert it to a string value that expresses the time
in terms of frames; see “timeToCurrentFormat() global function” on page 17.
It is an error to set this value for a FootageItem whose m a in S o u rc e is still (ite m .m a in S o u rc e . i s S t i l l is true).
Type
Description
Type
Description
When true, a proxy is used for the item. It is set to true by all the S e tP r o x y methods, and to false by the
S e t Pr o x y T o N o n e () method.
Type
Boolean; read/write.
Description
Type
38
JavaScript Reference AVLayer object
39
AVLayer object
a pp .p r o j e c t .i te m (i nd e x) .l a y e r ( inde x)
Description
The AVLayer object provides an interface to those layers that contain AVItem objects (Comp layers, footage
layers, solid layers, text layers, and sound layers).
• AVLayer is a subclass of Layer. All methods and attributes of Layer, in addition to those listed below, are
available when working with AVLayer. See “Layer object” on page 83.
• AVLayer is a base class for TextLayer, so AVLayer attributes and methods are available when working with
TextLayer objects. See “TextLayer object” on page 172.
AE Properties
Different types of layers have different AE properties. AVLayer has the following properties and property
groups:
Ma r k e r
T i m e R em a p
Motion Trackers
M a s ks
E f f e c ts
T r a n s f o rm
A n ch o r P o i n t
P o s i ti o n
S c al e
O r i e n t a t io n
X R o t at io n
Y R o t at io n
Ro ta ti on
O pa c i ty
Layer Styles
M a t e r i a l O pt i o n s
Ca st s Sh ad ow s
L i g h t T r a n s m is s io n
Ac c e pt s S h ad ow s
Ac c e pt s Li gh ts
Am bie n t
D if f u s e
S p e c u l ar
Shininess
M eta l
Au dio
Au dio L evels
Example
If the first item in the project is a CompItem, and the first layer of that CompItem is an AVLayer, the following
sets the layer qua l i ty , s t art T i m e , and in Poi n t .
va r f ir st L ay e r = a p p. pro jec t .i te m (1 ). l ay er( 1) ;
f i rst L a ye r.q ua li t y = L a y erQ ua li t y .BE ST ;
first L a ye r.sta rt Tim e = 1 ;
39
JavaScript Reference AVLayer object
40
f i r s t L a ye r. i n P o i n t = 2 ;
Attributes
isNameFromSource “AVLayer isNameFromSource attribute” When true, the layer has no expressly set name,
on page 46 but contains a named source.
m o t i o n B lu r “AVLayer motionBlur attribute” on When true, the layer's motion blur is enabled.
page 46
effectsActive “AVLayer effectsActive attribute” on When true, the layer's effects are active.
page 44
t hre eDLa yer “AVLayer threeDLayer attribute” on When true, this is a 3D layer.
page 48
t hre eDP er C ha r “AVLayer threeDPerChar attribute” on When true, 3D is set on a per-character basis in
page 48 this text layer.
f r am e Bl e n di n g T y p e “AVLayer frameBlendingType attribute” The type of frame blending for the layer.
on page 45
t im eRem ap E n ab l e d “AVLayer timeRemapEnabled attribute” When true, time remapping is enabled on this
on page 48 layer.
h as Aud i o “AVLayer hasAudio attribute” on When true, the layer contains an audio compo-
page 45 nent.
a ud io Ac ti ve “AVLayer audioActive attribute” on When true, the layer's audio is active at the cur-
page 41 rent time.
t rac k M a tt eT y p e “AVLayer trackMatteType attribute” on if layer has a track matte, specifies the way it is
page 49 applied.
40
JavaScript Reference AVLayer object
41
i s T r a c k M a tt e “AVLayer isTrackMatte attribute” on When true, this layer is being used as a track
page 46 matte for the layer below it.
h as T rac k Ma tt e “AVLayer hasTrackMatte attribute” on When true, the layer above is being used as a
page 45 track matte on this layer.
a uto Ori e n t “AVLayer autoOrient attribute” on The type of automatic orientation for the layer.
page 42
Methods
re pla c eSource () “AVLayer replaceSource() method” on Changes the source item for this layer.
page 47
Description
Type
Boolean; read/write.
Description
Type
Boolean; read-only.
41
JavaScript Reference AVLayer object
42
Description
Returns true if this layer's audio will be active at the specified time.
For this method to return true, a ud i oE n a b le d must be true, no other layer with audio may be soloing unless
this layer is soloed too, and the time must be between the i n P o i n t and o u t P o i n t of this layer.
Parameters
Returns
Boolean.
Description
When true, the layer's audio is enabled. This value corresponds to the audio toggle switch in the Timeline
panel.
Type
Boolean; read/write.
Description
Type
Description
Type
42
JavaScript Reference AVLayer object
43
B le n ding Mode.A DD
B le n d in g Mod e.A L P HA_ A DD
B le n d in g M o d e . C L A S S I C _ C O L O R _ B UR N
B le n d in g M o d e . C L A S S I C _ C O L O R _ D O D G E
B le n d i n g M o d e . C L A S S I C _ D I F F E R E N C E
B le n d in g M o d e . C OL O R
B le n d in g M o d e . C OL O R _ B UR N
B le n d in g M o d e . C OL O R _ D O D G E
B le n d in g M o d e . D A N C I N G _ D I S S O L V E
B le n d i n g M o d e . D AR K E N
B le n d ing Mod e.D ARK E R_COL OR
B le n d i n g M o d e . D I F F E R E N C E
B le n d in g M o d e . D I S S O L V E
B le n di n g M o d e . E XCL U S I O N
B le n d in g Mod e.H AR D_ L I G H T
B le n di n g M o d e . H AR D_ M I X
B le n ding Mode.H UE
B le n d i n g M o d e . L I G H T E N
B le n d in g M o d e . L I G H T E R _ C O L O R
B le n d in g M o d e . L I N E A R _ B U R N
B le n di n g M o d e . L I N E A R _ D O D G E
B le n d i n g M o d e . L I N E A R _ L I GH T
B le n ding Mode.L UMIN E SC ENT_PREMU L
B le n d i n g M o d e . L UM I N OS I T Y
B le n d in g M o d e . M UL T I PL Y
B le n ding Mode.N ORM AL
B le n d in g M o d e . O V E RL A Y
B le n d in g M o d e . P I N _ L I GH T
B le n d in g M o d e . S A T U R A T I O N
B le n d i n g M o d e . S C R E E N
B le n d in g M o d e . S I L H O U E T E _ A L P H A
B le n d in g M o d e . S I L H O U E T T E _ L U M A
B le n d in g M o d e . S O F T _ L I G H T
B le n d in g M o d e . S T E N C I L _ A L P H A
B le n d in g M o d e . S T E N C I L _ L U M A
B le n d in g M o d e . V I V I D _ L I G H T
Description
Parameters
43
JavaScript Reference AVLayer object
44
Returns
Example
va r new L a y er = comp.layer s. add(ne wFoo ta ge);
ne wLa y er. thr eeD Layer = t rue ;
n e w L a y e r . b le n d in g M o d e = B l e n d i n g M o d e . A L P H A _ A D D ;
va r t rans f orm = new L aye r.calcu late Tra n sf orm F romP oints ( tl, t r, bl) ;
for(va r se l in tra n sfor m) {
n e w L a y e r . tr a n s f o r m [ s e l ] .s e t V al u e ( tr a n s for m [s e l ] ) ;
}
Description
Type
Boolean; read-only.
Description
True if it is legal to change the value of the time RemapE nabled attribute on this layer.
Type
Boolean; read-only.
Description
Type
Boolean; read/write.
Description
True if the layer's effects are active, as indicated by the <f> icon next to it in the user interface.
44
JavaScript Reference AVLayer object
45
Type
Boolean; read/write.
Description
Type
Boolean; read-only.
Description
The type of frame blending to perform when frame blending is enabled for the layer.
Type
Description
Type
Boolean; read/write.
Description
True if the layer contains an audio component, regardless of whether it is audio-enabled or soloed.
Type
Boolean; read-only.
45
JavaScript Reference AVLayer object
46
Description
True if the layer in front of this layer is being used as a track matte on this layer. When true, this layer's t rac k -
M a t t e T y p e value controls how the matte is applied.
Type
Boolean; read-only.
Description
Type
Floating-point; read-only.
Description
True if the layer has no expressly set name, but contains a named source. In this case, l a y e r. n am e has the same
value as l a y e r .s ource .name .
False if the layer has an expressly set name, or if the layer does not have a source.
Type
Boolean; read-only.
Description
True if this layer is being used as a track matte for the layer behind it.
Type
Boolean; read-only.
Description
Type
Boolean; read/write.
46
JavaScript Reference AVLayer object
47
Description
Type
Boolean; read/write.
Description
Type
Description
Parameters
f i xE xp re ss i on s T rue to adjust expressions for the new source, fa l se otherwise. Note that this feature can be
resource-intensive; if replacing a large amount of footage, do this only at the end of the operation.
See also “Project autoFixExpressions() method” on page 110.
Returns
Nothing.
Description
The source AVItem for this layer. The value is null in a Text layer. Use AV Layer .re pla ce S ource () to change the
value.
Type
47
JavaScript Reference AVLayer object
48
Description
Retrieves the rectangle bounds of the layer at the specified time index, corrected for text or shape layer content.
Use, for example, to write text that is properly aligned to the baseline.
Parameters
e x t en t s T rue to include the extents, fa l se otherwise. Extents apply to shape layers, increasing the size of
the layer bounds as necessary.
Returns
Description
Type
Boolean; read/write.
Description
True if this layer has the Enable Per-character 3D switch set, allowing its characters to be animated off the
plane of the text layer. Applies only to text layers.
Type
Boolean; read/write.
Description
Type
Boolean; read/write.
48
JavaScript Reference AVLayer object
49
Description
If this layer has a track matte, specifies the way the track matte is applied.
Type
Description
Type
Floating-point; read-only.
49
JavaScript Reference CameraLayer object
50
CameraLayer object
a pp .p r o j e c t .i te m (i nd e x) .l a y e r( in de x)
Description
The CameraLayer object represents a camera layer within a composition. Create it using the LayerCollection
object’s ad d C am e r a method; see “LayerCollection addCamera() method” on page 93. It can be accessed in an
item’s layer collection either by index number or by a name string.
• CameraLayer is a subclass of Layer. All methods and attributes of Layer are available when working with
CameraLayer. See “Layer object” on page 83.
AE Properties
CameraLayer defines no additional attributes, but has different AE properties than other layer types. It has the
following properties and property groups:
Ma r k e r
T r a n s f o rm
P oi n t o f In ter es t
P o s i ti o n
S c al e
O r i e n t a t io n
X R o t at io n
Y R o t at io n
Ro ta ti on
O pa c i ty
C a m e r a O p t io n s
Zoom
D ep th of F i el d
F o c u s D is t a n c e
B l ur L ev el
50
JavaScript Reference Collection object
51
Collection object
Like an array, a collection associates a set of objects or values as a logical group and provides access to them
by index. However, most collection objects are read-only. You do not assign objects to them yourself—their
contents update automatically as objects are created or deleted.
The index numbering of a collection starts with 1, not 0.
Objects
I t e m C o l le c t i o n “ItemCollection object” on page 79 All of the items (imported files, folders, solids, and so on) found in
the Project panel.
OMCollection “OMCollection object” on page 104 All of the Output Module items in the project.
Attributes
Methods
[] Retrieves an object in the collection by its index number. The first object is at index 1.
51
JavaScript Reference CompItem object
52
CompItem object
a pp .p r o j e c t .i te m (i nd e x)
a pp .p r o j e c t .i te m s[i n d ex ]
Description
The CompItem object represents a composition, and allows you to manipulate and get information about it.
Access the objects by position index number in a project’s i t e m collection.
• CompItem is a subclass of AVItem, which is a subclass of Item. All methods and attributes of AVItem and
Item, in addition to those listed below, are available when working with CompItem. See “AVItem object”
on page 32 and “Item object” on page 76.
Example
Given that the first item in the project is a CompItem, the following code displays two alerts. The first shows
the number of layers in the CompItem, and the second shows the name of the last layer in the CompItem.
va r f ir st C omp = ap p. pr oje ct .i t em( 1) ;
a l e r t (" n u m b e r o f l a y e r s i s " + f i r s t C o m p . n u m L a y e r s ) ;
a l ert (" n a m e of l as t l a y er i s " + f i rs t C o m p. la y er( f ir st C o m p .n u m L ay e rs ).n am e) ;
Attributes
f ram eDu rat ion “CompItem frameDuration attribute” on The duration of a single frame.
page 55
h id eS hy L a y ers “CompItem hideShyLayers attribute” on When true, shy layers are visible in the Timeline panel.
page 55
m o t i o n B lu r “CompItem motionBlur attribute” on When true, motion blur is enabled for this composi-
page 56 tion.
d r a ft 3 d “CompItem draft3d attribute” on When true, Draft 3D mode is enabled for the Compo-
page 54 sition panel.
f r am e Bl e n di n g “CompItem frameBlending attribute” When true, time filtering is enabled for this composi-
on page 54 tion.
preser veNe st edFrame Rat e “CompItem preserveNestedFrameRate When true, the frame rate of nested compositions is
attribute” on page 56 preserved.
displayStartTime “CompItem displayStartTime attribute” Changes the display of the start time in the Timeline
on page 54 panel.
52
JavaScript Reference CompItem object
53
re so lu tionFa ctor “CompItem resolutionFactor attribute” The factor by which the x and y resolution of the Com-
on page 57 position panel is downsampled.
re nde rer “CompItem renderer attribute” on The rendering plugin module to be used to render
page 57 this composition.
re nde rer s “CompItem renderers attribute” on The set of available rendering plugin modules.
page 57
Methods
d u p l i ca te () “CompItem duplicate() method” on page 54 Creates and returns a duplicate of this composition.
Description
The active camera, which is the front-most camera layer that is enabled. The value is null if the composition
contains no enabled camera layers.
Type
Description
The background color of the composition. The three array values specify the red, green, and blue components
of the color.
Type
An array containing three floating-point values, [R, G, B], in the range [0.0..1.0]; read/write.
53
JavaScript Reference CompItem object
54
Description
The time set as the beginning of the composition, in seconds. This is the equivalent of the Start Timecode or
Start Frame setting in the Composition Settings dialog box.
Type
Floating-point value in the range [0.0...86339.0] (1 second less than 25 hours); read/write.
Description
When true, Draft 3D mode is enabled for the Composition panel. This corresponds to the value of the Draft
3D button in the Composition panel.
Type
Boolean; read/write.
Description
Creates and returns a duplicate of this composition, which contains the same layers as the original.
Parameters
None.
Returns
CompItem object.
Description
When true, frame blending is enabled for this Composition. Corresponds to the value of the Frame Blending
button in the Composition panel.
Type
54
JavaScript Reference CompItem object
55
Description
The duration of a frame, in seconds. This is the inverse of the fr ameR at e value (frames-per-second).
Type
Floating-point; read/write.
Description
When true, only layers with s h y set to false are shown in the Timeline panel. When false, all layers are visible,
including those whose sh y value is true. Corresponds to the value of the Hide All Shy Layers button in the
Composition panel.
Type
Boolean; read/write.
Description
Returns a Layer object, which can be specified by name, an index position in this layer, or an index position
relative to another layer.
Parameters
index The index number of the desired layer in this composition. An integer in the range [1...num-
Layers], where n u m L a y e r s is the number of layers in the composition.
—or—
otherLayer A Layer object in this composition. The relIn de x value is added to the index value of this
layer to find the position of the desired layer.
relIndex The position of the desired layer, relative to oth erLa y er . An integer in the range [1–othe r-
L a ye r . i n d e x . . . numLayers–ot her L ayer .index ], where n u m L a y e r s is the number of
layers in the composition.
This value is added to the oth erLa y er value to derive the absolute index of the layer to
return.
—or—
55
JavaScript Reference CompItem object
56
Returns
Layer object.
Description
A LayerCollection object that contains all the Layer objects for layers in this composition. See “LayerCol-
lection object” on page 92.
Type
Description
When true, motion blur is enabled for the composition. Corresponds to the value of the Motion Blur button
in the Composition panel.
Type
Boolean; read/write.
Description
Type
Integer; read-only.
Description
When true, the frame rate of nested compositions is preserved in the current composition. Corresponds to the
value of the “Preserve frame rate when nested or in render queue” option in the Advanced tab of the Compo-
sition Settings dialog box.
Type
Boolean; read/write.
56
JavaScript Reference CompItem object
57
Description
When true, the resolution of nested compositions is preserved in the current composition. Corresponds to the
value of the “Preserve Resolution When Nested” option in the Advanced tab of the Composition Settings
dialog box.
Type
Boolean; read/write.
Description
The current rendering plugin module to be used to render this composition, as set in the Advanced tab of the
Composition Settings dialog box. Allowed values are the members of c o m p I t e m.ren de rers .
Type
String; read/write.
Description
The available rendering plugin modules. Member strings reflect installed modules, as seen in the Advanced
tab of the Composition Settings dialog box.
Type
Description
Type
57
JavaScript Reference CompItem object
58
Description
All of the selected layers in this composition. This is a 0-based array (the first object is at index 0).
Type
Description
All of the selected properties (Property and PropertyGroup objects) in this composition. The first property is
at index position 0.
Type
Description
The shutter angle setting for the composition. This corresponds to the Shutter Angle setting in the Advanced
tab of the Composition Settings dialog box.
Type
Description
The shutter phase setting for the composition. This corresponds to the Shutter Phase setting in the Advanced
tab of the Composition Settings dialog box.
Type
Description
The duration of the work area in seconds. This is the difference of the start-point and end-point times of the
Composition work area.
58
JavaScript Reference CompItem object
59
Type
Floating-point; read/write.
Description
Type
Floating-point; read/write.
59
JavaScript Reference FileSource object
60
FileSource object
a pp .p r o j e c t .i te m (i nd e x) . m a in So ur c e
a pp .p r o j e c t .i te m (i nd e x) .p roxySour ce
Description
Attributes
f i le “FileSource file attribute” on page 60 The file that defines this asset.
m i s s i n g F o ot a g e P a t h “FileSource missingFootagePath attribute” The file that contains footage missing from this asset.
on page 60
Methods
reload() “FileSource reload() method” on page 61 Reloads the asset from the file, if it is a m a i n So u r c e of
a FootageItem.
Description
The ExtendScript File object for the file that defines this asset. To change the value:
• If this FileSource is a pr ox y So urc e of an AVItem, call s e t Pr o x y () or s et P rox y Wi th Se qu ence( ) .
• If this FileSource is a m a i n S o u r c e of a FootageItem, call re pla c e() or r e p l a c e W i t h S e q u e n c e ( ) .
Type
Description
The path and filename of footage that is missing from this asset. See also “AVItem footageMissing attribute”
on page 33.
Type
String; read-only.
60
JavaScript Reference FileSource object
61
Description
Reloads the asset from the file. This method can be called only on a m a i n S o u rc e , not a p r o x y S o u r ce .
Parameters
None.
Returns
Nothing.
61
JavaScript Reference FolderItem object
62
FolderItem object
a pp . p r o j e c t .F o l d e r I t e m
Description
The FolderItem object corresponds to a folder in your Project panel. It can contain various types of items
(footage, compositions, solids) as well as other folders.
Example
Given that the second item in the project is a FolderItem, the following code puts up an alert for each top-level
item in the folder, showing that item’s name.
va r s ec ond It em = ap p. pr ojec t .i te m ( 2) ;
i f ( ! ( s e c o n d I t e m i n st a n ce o f F o l de r I t e m ) ) {
a l e r t (" p r o b l e m : s e c o n d i t e m i s n o t a f o l d e r " ) ;
} else {
f or ( i = 1 ; i <= se cond Item .numI tem s; i + +) {
a l e r t ( " i t e m n u m b e r " + i + " w i t h i n t h e f o l d e r i s n am e d "
+ se cond Ite m .ite m(i) .na m e) ;
}
}
Attributes
nu mIte ms “FolderItem numItems attribute” on page 63 The number of items contained in the folder.
Methods
Description
Returns the top-level item in this folder at the specified index position. Note that “top-level” here means top-
level within the folder, not necessarily within the project.
Parameters
index An integer, the position index of the item to retrieve. The first item is at index 1.
Returns
Item object.
62
JavaScript Reference FolderItem object
63
Description
An ItemCollection object containing Item object that represent the top-level contents of this folder.
Unlike the ItemCollection in the Project object, this collection contains only the top-level items in the folder.
Top-level within the folder is not the same as top-level within the project. Only those items that are top-level
in the root folder are also top-level in the Project.
Type
Description
Type
63
JavaScript Reference FootageItem object
64
FootageItem object
a pp .p r o j e c t .i te m (i nd e x)
a pp .p r o j e c t .i te m s[i n d ex ]
Description
The FootageItem object represents a footage item imported into a project, which appears in the Project panel.
These are accessed by position index number in a project’s i te m collection.
• FootageItem is a subclass of AVItem, which is a subclass of Item. All methods and attributes of AVItem and
Item, in addition to those listed below, are available when working with FootageItem. See “AVItem object”
on page 32 and “Item object” on page 76.
Attributes
m a i n So u r c e “FootageItem mainSource attribute” on page 65 All settings related to the footage item.
Methods
re pla c e() “FootageItem replace() method” on Replaces a footage file with another footage file.
page 65
re pla c eWith S equ ence() “FootageItem replaceWithSequence() Replaces a footage file with an image sequence.
method” on page 66
Description
Type
64
JavaScript Reference FootageItem object
65
Description
The footage source, an object that contains all of the settings related to that footage item, including those that
are normally accessed through the Interpret Footage dialog box. The attribute is read-only. To change its value,
call one of the FootageItem “replace” methods.
See the “FootageSource object” on page 67, and its three types:
• “SolidSource object” on page 168
• “FileSource object” on page 60
• “PlaceholderSource object” on page 108
If this is a FileSource object, and the f o o t a g e M i s s i n g value is true, the path to the missing footage file is in the
F i l e S o u r c e . m i s si n g F o o t a g e P a t h attribute. See “AVItem footageMissing attribute” on page 33 and
“FileSource missingFootagePath attribute” on page 60.
Type
Description
Changes the source of this FootageItem to the specified file. In addition to loading the file, the method creates
a new FileSource object for the file and sets m a in S o u rc e to that object. In the new source object, it sets the
n a m e , w i dt h , h ei g ht , fr ame Dur at io n , and du rat i on attributes (see “AVItem object” on page 32) based on the
contents of the file.
The method preserves interpretation parameters from the previous m a i n S o u r ce object. If the specified file has
an unlabeled alpha channel, the method estimates the alpha interpretation.
Parameters
file An ExtendScript File object for the file to be used as the footage main source.
Description
Changes the source of this FootageItem to the specified placeholder. Creates a new PlaceholderSource object,
sets its values from the parameters, and sets m a i n S o u rc e to that object.
Parameters
65
JavaScript Reference FootageItem object
66
f r am e R a te The frame rate of the placeholder, a floating-point value in the range [1.0..99.0]
d u r a ti o n The duration of the placeholder in seconds, a floating-point value in the range [0.0..10800.0].
Description
Changes the source of this FootageItem to the specified image sequence. In addition to loading the file, the
method creates a new FileSource object for the file and sets m a in S o u rc e to that object. In the new source
object, it sets the n a m e , w i dt h , h ei g ht , f r a m e D u r at i o n , and du rat i on attributes (see “AVItem object” on
page 32) based on the contents of the file.
The method preserves interpretation parameters from the previous m a i n S o u r ce object. If the specified file has
an unlabeled alpha channel, the method estimates the alpha interpretation.
Parameters
file An ExtendScript File object for the first file in the sequence to be used as the footage main source.
Description
Changes the source of this FootageItem to the specified solid. Creates a new SolidSource object, sets its values
from the parameters, and sets m a i n S o u rc e to that object.
Parameters
color The color of the solid, an array of three floating-point values, [R, G, B], in the range [0.0..1.0].
p i xe l A s pe c t The pixel aspect ratio of the solid, a floating-point value in the range [0.01..100.0].
66
JavaScript Reference FootageSource object
67
FootageSource object
a pp .p r o j e c t .i te m (i nd e x) .m a in So u r c e
a pp .p r o j e c t .i te m (i nd e x) .p roxySour ce
Description
The FootageSource object holds information describing the source of some footage. It is used as the
m a i n So u r c e of a FootageItem, or the pr ox y So urc e of a CompItem or FootageItem. See “FootageItem object”
on page 64 and “CompItem object” on page 52.
• FootageSource is the base class for SolidSource, so FootageSource attributes and methods are available
when working with SolidSource objects. See “SolidSource object” on page 168.
Attributes
loop “FootageSource loop attribute” on How many times an image sequence is set to loop.
page 71
na tive Fr ame Rat e “FootageSource nativeFrameRate The native frame rate of the footage.
attribute” on page 71
d i sp l ay F r a m e R ate “FootageSource displayFrameRate The effective frame rate as displayed and rendered
attribute” on page 68 in compositions by After Effects.
Methods
67
JavaScript Reference FootageSource object
68
Description
The alphaMode attribute of footageSource defines how the alpha information in the footage is to be inter-
preted. If hasAlpha is false, this attribute has no relevant meaning.
Type
Description
A frame rate to use instead of the na tive Frame Rat e value. If set to 0, the na tive Frame Rat e is used instead.
It is an error to set this value if F o o t a g e So u r c e . i sS ti l l is true. It is an error to set this value to 0 if r em ove -
P u l l d o w n is not set to P u l l d o w n Ph a s e . O F F . If this is 0 when you set r e m o v e P u ll d o w n to a value other than
P u l l d o w n Ph a s e . O F F , then this is automatically set to the value of na tive Fram eRat e .
Type
Description
The effective frame rate as displayed and rendered in compositions by After Effects.
If r e m o v e P u l ld o w n is P u l l do wn P h a s e . O F F , then this is the same as the co n f o rm F r a m e R a t e (if non-zero) or
the na tive Frame Rat e (if c o n f o r m F r a m e R a t e is 0). If r e m o v e P u l ld o w n is not Pu l ld ow n P ha se .O FF , this is
c o n f o r m F r a m e R a t e * 0.8, the effective frame rate after removing 1 of every 5 frames.
Type
68
JavaScript Reference FootageSource object
69
Description
Type
Description
Sets a l ph aMo de , p r e m u l C o l o r , and i n v e r tA lp h a to the best estimates for this footage source. If h a s A l p h a is
false, no change is made.
Parameters
None.
Returns
Nothing.
Description
Sets f i el d Se pa ra ti on T y p e and r e m ov e P u l l d o w n to the best estimates for this footage source. If i s St i l l is true,
no change is made.
Parameters
me tho d The method to use for estimation. A P u l l d o w n M e t h o d enumerated value, one of:
P u l l d o w n M e th od . P U L L D O W N _ 3 _ 2
Pulldow nMe th od. AD VANCE _ 24P
Returns
Nothing.
69
JavaScript Reference FootageSource object
70
Description
When true, the footage has an alpha component. In this case, the attributes a l p h a M o d e , in v ert Al p ha , and
p r e m u l C o l o r have valid values. When false, those attributes have no relevant meaning for the footage.
Type
Boolean; read-only.
Description
When true, After Effects uses special algorithms to determine how to perform high-quality field separation.
It is an error to set this attribute if i sS t il l is true, or if fie ld S ep ar at io nType is Fie l dSepa rat io nType.O F F .
Type
Boolean; read/write.
Description
Type
Boolean; read/write.
Description
When true the footage is still; when false, it has a time-based component.
Examples of still footage are JPEG files, solids, and placeholders with duration of 0. Examples of non-still
footage are movie files, sound files, sequences, and placeholders of non-zero duration.
Type
Boolean; read-only.
70
JavaScript Reference FootageSource object
71
Description
The number of times that the footage is to be played consecutively when used in a composition.
It is an error to set this attribute if i sS t il l is true.
Type
Description
Type
Floating-point; read/write.
Description
The color to be premultiplied. This attribute is valid only if the a l p haM od e is a l ph aM ode .PREMU L TIPLIED .
Type
Description
Type
71
JavaScript Reference FootageSource object
72
P u l l d o w n Ph a s e . R e m o v e P u l l do wn . SW W W S
P u l l d o w n P h a s e . R e m o v e P u l l d o wn . W W W S S
P u l l d o w n Ph a s e . R e m o v e P u l l do wn . W W S S W
P u l l d o w n Ph a s e . R e m o v e P u l l d o wn . W S SW W _ 2 4 P _ A D V A N C E
P u l l d o w n Ph a s e . R e m o v e P u l l do wn . SS W W W _ 2 4 P _ A D V A N C E
P u l l d o w n Ph a s e . R e m o v e P u l l do wn . SW W W S _ 2 4 P _ A D V A N C E
P u l l d o w n Ph a s e . R e m o v e P u l l do wn . W W W S S _ 2 4 P _ A D V A N C E
P u l l d o w n Ph a s e . R e m o v e P u l l do wn . W W S S W _ 2 4 P _ A D V A N C E
72
JavaScript Reference ImportOptions object
73
ImportOptions object
n e w I m p o r tO pt i o n s () ;
n e w I m p o r tO pt i o n s (f i l e ) ;
Description
The ImportOptions object encapsulates the options used to import a file with the P r o je c t .i m p o r t F il e
methods. See “Project importFile() method” on page 112.
The constructor takes an optional parameter, an ExtendScript File object for the file. If it is not supplied, you
must explicitly set the value of the f i l e attribute before using the object with the i m p o r t Fi l e method. For
example:
n e w I m p o r tO pt i o n s () .f i l e = n e w F il e (" m y f i l e .p s d" ) ;
Attributes
sequence “ImportOptions sequence attribute” on When true, import a sequence of files, rather than an individ-
page 75 ual file.
f o r c e A l ph ab e t i c al “ImportOptions forceAlphabetical When true, the “Force alphabetical order” option is set.
attribute” on page 74
f i le “ImportOptions file attribute” on The file to import, or the first file of the sequence to import.
page 74
Methods
Description
Reports whether the file can be imported as the source of a particular object type. If this method returns true,
you can set the given type as the value of the i m p o r t A s attribute. See “ImportOptions importAs attribute” on
page 74.
Parameters
t y pe The type of file that can be imported. An I m p o r t A s T y p e enumerated value; one of:
ImportAsType.COMP
I m p o r t A s T y p e . F O O T A GE
I m p ort As T y pe .C O MP _ C R O PP E D _ L AY E R S
ImportAsType.PROJECT
73
JavaScript Reference ImportOptions object
74
Returns
Boolean.
Example
v a r i o = n e w I m p o r t Op ti o n s( F i le (“ c : \ \ m y F il e .p sd ” ) );
if io .canIm po rtA s(ImportAsType .CO MP);
i o .i m p o r tAs = I m po r tA sT yp e . C OM P ;
Description
The file to be imported. If a file is set in the constructor, you can access it through this attribute.
Type
Description
When true, has the same effect as setting the “Force alphabetical order” option in the File > Import > File
dialog box.
Type
Boolean; read/write.
Description
The type of object for which the imported file is to be the source. Before setting, use c a n I m p o r t A s to check
that a given file can be imported as the source of the given object type. See “ImportOptions canImportAs()
method” on page 73.
Type
74
JavaScript Reference ImportOptions object
75
Description
Type
Boolean; read/write.
75
JavaScript Reference Item object
76
Item object
a pp . p r o j e c t .i t e m ( i n d e x )
a pp . p r o j e c t . i te m s[ i n de x ]
Description
The Item object represents an item that can appear in the Project panel.
The first item is at index 1.
• Item is the base class for AVItem and for FolderItem, which are in turn the base classes for various other
item types, so Item attributes and methods are available when working with all of these item types. See
“AVItem object” on page 32 and “FolderItem object” on page 62.
Attributes
name “Item name attribute” on page 77 The name of the object as shown in the Project panel.
selected “Item selected attribute” on page 78 When true, this item is currently selected.
Methods
re move () “Item remove() method” on page 78 Deletes the item from the project.
Example
This example gets the second item from the project and checks that it is a folder. It then removes from the
folder any top-level item that is not currently selected. It also checks to make sure that, for each item in the
folder, the parent is properly set to the correct folder.
var myFolder = app.project.item(2);
i f (m y F o l d e r .ty p e N a m e ! = " F o l d e r " ) {
a l ert ("er ror: se cond it em is not a folde r");
}
else {
var numInFolder = myFolder.numItems;
/ / A l w ay s r u n lo o p s b a c kw ar ds w hen d el e ti n g t hi n g s :
for(i = numInFolder; i >= 1; i--) {
va r curI tem = myFolder. i tem (i);
if ( cur I te m.pare ntFo ld er != m yFo lde r) {
a l ert (" er ro rw i th i n AE : t he pa ren t F o l d er i s n o t s et c o rre c tl y " ) ;
}
else {
i f ( ! c u rI t e m . s e l e c t ed & & c u r I t e m . t y p e N a m e = = " F o o t a g e " ) {
/ / A h a ! a n u n s e l e c t e d so l id .
curItem.remove();
76
JavaScript Reference Item object
77
}
}
}
}
Description
A string that holds a comment, up to 15,999 bytes in length after any encoding conversion. The comment is
for the user's purpose only; it has no effect on the item's appearance or behavior.
Type
String; read/write.
Item id attribute
a pp .p r o j e c t .i te m (i nd e x) .i d
Description
A unique and persistent identification number used internally to identify an item between sessions. The value
of the ID remains the same when the project is saved to a file and later reloaded. However, when you import
this project into another project, new IDs are assigned to all items in the imported project. The ID is not
displayed anywhere in the user interface.
Type
Integer; read-only.
Description
Type
String; read/write.
Description
The FolderItem object for the folder that contains this item. If this item is at the top level of the project, this
is the project's root folder (a pp . p r o j e c t . r o o t F o l d e r ). You can use the ItemCollection’s ad d F o l de r method to
add a new folder, and set this value to put items in the new folder. See “ItemCollection addFolder() method”
on page 79.
77
JavaScript Reference Item object
78
Type
Example
This script creates a new FolderItem in the Project panel and moves compositions into it.
/ / c r e at e a n e w F o l d e r I t e m in p r o je c t , w i t h n a m e “ c o m p s ”
v a r c o m p F o l d e r = ap p .p r o j e c t. it e m s .a dd F o l d e r ( “ c o m p s ” );
/ / m o v e a l l c o m po s i t i o n s i n t o n e w f o l d e r b y s e t t in g
/ / c o m p I t e m ’ s p a r e n tF o l d e r t o “ c o m p s ” f o l d e r
f o r ( v a r i = 1 ; i < = a p p . p r o j e ct . n u m I t e m s ; i + + ) {
if (a pp .p ro ject .item (i) in st anceo f Co mp Item )
a pp . p r o j e c t .i t e m ( i ) . p a r e n t F o l d e r = c o m p F o l d e r ;
}
Description
Deletes this item from the project and from the Project panel. If the item is a FolderItem, all the items
contained in the folder are also removed from the project. No files or folders are removed from disk.
Parameters
None.
Returns
Nothing.
Description
When true, this item is selected. Multiple items can be selected at the same time. Set to true to select the item
programmatically, or to false to deselect it.
Type
Boolean; read/write.
Description
A user-readable name for the item type; for example, “Folder”, “Footage”, or “Composition”.
Type
String; read-only.
78
JavaScript Reference ItemCollection object
79
ItemCollection object
a pp .p r o j e c t .i te m s
Description
The ItemCollection object represents a collection of items. The ItemCollection belonging to a Project object
contains all the Item objects for items in the project. The ItemCollection belonging to a FolderItem object
contains all the Item objects for items in that folder.
• ItemCollection is a subclass of Collection. All methods and attributes of Collection, in addition to those
listed below, are available when working with ItemCollection. See “Collection object” on page 51.
Methods
a dd C om p( ) “ItemCollection addComp() method” on Creates a new CompItem object and adds it to the collection.
page 79
a dd F o l d e r ( ) “ItemCollection addFolder() method” on Creates a new FolderItemobject and adds it to the collection.
page 79
Description
Creates a new composition. Creates and returns a new CompItem object and adds it to this collection.
If the ItemCollection belongs to the project or the root folder, then the new item’s pa rent F ol d er is the root
folder. If the ItemCollection belongs to any other folder, the new item’s pa rent F ol d er is that F o l d e r I t e m .
Parameters
p i xe l A s pe c t The pixel aspect ratio of the composition, a floating-point value in the range [0.01..100.0].
d u r a ti o n The duration of the composition in seconds, a floating-point value in the range [0.0..10800.0].
f r am e R a te The frame rate of the composition, a floating-point value in the range [1.0..99.0]
Returns
CompItem object.
Description
Creates a new folder. Creates and returns a new FolderItem object and adds it to this collection.
79
JavaScript Reference ItemCollection object
80
If the ItemCollection belongs to the project or the root folder, then the new folder’s pa ren tF ol d er is the root
folder. If the ItemCollection belongs to any other folder, the new folder’s p ar e n t F o l de r is that F o ld e r I t e m .
To put items in the folder, set the item object’s pa rent F ol d er attribute; see “Item parentFolder attribute” on
page 77.
Parameters
Returns
FolderItem object.
Example
This script creates a new FolderItem in the Project panel and moves compositions into it.
/ / c r e at e a n e w F o l d e r I t e m in p r o je c t , w i t h n a m e “ c o m p s ”
v a r c o m p F o l d e r = ap p .p r o j e c t. it e m s .a dd F o l d e r ( “ c o m p s ” );
/ / m o v e a l l c o m po s i t i o n s i n t o n e w f o l d e r b y s e t t in g
/ / c o m p I t e m ’ s p a r e n tF o l d e r t o “ c o m p s ” f o l d e r
f o r ( v a r i = 1 ; i < = a p p . p r o j e ct . n u m I t e m s ; i + + ) {
if (a pp .p ro ject .item (i) in st anceo f Co mp Item )
a pp . p r o j e c t .i t e m ( i ) . p a r e n t F o l d e r = c o m p F o l d e r ;
}
80
JavaScript Reference KeyframeEase object
81
KeyframeEase object
m y K e y = n e w K e y f r a m e E a s e (s p ee d, i n f l u e n c e ) ;
Description
The KeyframeEase object encapsulates the keyframe ease settings of a layer’s AE property. There are two types
of ease, temporal and spatial, which are determined by the speed and influence settings. Both types are set
using the property’s setT empora lEaseAt K ey method. See “Property setTemporalEaseAtKey() method” on
page 136.
The constructor creates a KeyframeEase object. Both parameters are required.
• s p e e d : A floating-point value. Sets the s pe e d attribute.
• i n f l u e n c e : A floating-point value in the range [0.1..100.0]. Sets the i n fl u e n c e attribute.
Example
This example assumes that the Position, a spatial property, has more than two keyframes.
va r ea se In = n ew Ke yfr ameE as e( 0.5 , 50) ;
v a r e a se Ou t = n e w K e y fr am e E as e ( 0 .7 5 , 8 5 ) ;
va r m y P o s it i o n P ro p ert y = a p p. pro jec t .i te m( 1). l ay er (1) .p ro pe rty ( " P o si t i o n " )
m y P o s i t i o n P r o p e r t y . s e t T e m p o r a l E a s eA tK e y ( 2 , [ e a s e I n ] , [ e a s e O u t ] ) ;
This example sets the Scale, a temporal property with two dimensions. For 2D and 3D properties you must
set an easeI n and e as eO ut value for each dimension:
va r ea se In = n ew Ke yfr ameE as e( 0.5 , 50) ;
v a r e a se Ou t = n e w K e y fr am e E as e ( 0 .7 5 , 8 5 ) ;
va r myScalePro pe rty = app.proje c t. i t e m ( 1 ) .l ay e r ( 1 ). pr o p e r t y (" S c al e " )
m y S c al e Pro pe rty . se tT e m po ral E a se At Ke y (2 , [ eas eI n , easeIn , ea se In], [e aseO ut, ea seO ut , e aseO ut]);
Attributes
influence “KeyframeEase influence attribute” on page 81 The influence setting for a keyframe.
Description
The influence value of the keyframe, as shown in the Keyframe Velocity dialog box.
Type
81
JavaScript Reference KeyframeEase object
82
Description
The speed value of the keyframe. The units depend on the type of keyframe, and are displayed in the Keyframe
Velocity dialog box.
Type
82
JavaScript Reference Layer object
83
Layer object
a pp .p r o j e c t .i te m (i nd e x) .l a y e r( in de x)
Description
The Layer object provides access to layers within compositions. It can be accessed from an item’s layer
collection either by index number or by a name string.
• Layer is the base class for CameraLayer, TextLayer, LightLayer, and AVLayer, so Layer attributes and
methods are available when working with all layer types. See “AVLayer object” on page 39,
“CameraLayer object” on page 50, “LightLayer object” on page 97, and “TextLayer object” on page 172.
Layers contain AE properties, in addition to their JavaScript attributes and methods. For examples of how to
access properties in layers, see “PropertyBase object” on page 140.
Example
If the first item in the project is a CompItem, this example disables the first layer in that composition and
renames it. This might, for example, turn an icon off in the composition.
va r f ir st L ay e r = a p p. pro jec t .i te m (1 ). l ay er( 1) ;
first L a ye r.e nabled = fa lse;
f i rst L a ye r.n a m e = " Di s ab l ed L ay e r" ;
Attributes
index “Layer index attribute” on page 87 The index position of the layer.
s tr e tc h “Layer stretch attribute” on page 91 The time stretch percentage of the layer.
inPoint “Layer inPoint attribute” on page 87 The “in” point of the layer.
outPoint “Layer outPoint attribute” on page 89 The “out” point of the layer.
en abled “Layer enabled attribute” on page 86 When true, the layer is enabled.
solo “Layer solo attribute” on page 91 When true, the layer is soloed.
shy “Layer shy attribute” on page 90 When true, the layer is shy.
locked “Layer locked attribute” on page 87 When true, the layer is locked.
h as Vi de o “Layer hasVideo attribute” on page 86 When true, the layer contains a video component.
a ct i ve “Layer active attribute” on page 84 When true, the layer is active at the current time.
comment “Layer comment attribute” on page 85 A descriptive comment for the layer.
containingComp “Layer containingComp attribute” on page 85 The composition that contains this layer.
83
JavaScript Reference Layer object
84
i s N a m e Se t “Layer isNameSet attribute” on page 87 When true, the layer’s name has been explicitly set.
Methods
re move () “Layer remove() method” on page 90 Deletes the layer from the composition.
m o v e T o B eg i n n i n g ( ) “Layer moveToBeginning() method” on Moves the layer to the top of the composition (makes it the
page 88 first layer).
moveToEnd() “Layer moveToEnd() method” on Moves the layer to the bottom of the composition (makes it
page 88 the last layer).
m o v e A f t er ( ) “Layer moveAfter() method” on page 87 Moves the layer below another layer.
mo veBe fo re() “Layer moveBefore() method” on Moves the layer above another layer.
page 88
copyToComp() “Layer copyToComp() method” on Copies the layer to the top (beginning) of another compo-
page 86 sition.
a ct i v e A tT i m e ( ) “Layer activeAtTime() method” on Reports whether this layer will be active at a specified time.
page 84
s et Pa ren t W i th Jum p ( ) “Layer setParentWithJump() method” Sets a new parent for this layer.
on page 90
Description
Type
Boolean; read-only.
Description
Returns true if this layer will be active at the specified time. To return true, the layer must be enabled, no other
layer may be soloing unless this layer is soloed too, and the time must be between the i n Po in t and o u t P o in t
values of this layer.
84
JavaScript Reference Layer object
85
Parameters
Returns
Boolean.
Description
Applies the specified collection of animation settings (an animation preset) to the layer. Predefined animation
preset files are installed in the Presets folder, and users can create new animation presets through the user
interface.
Parameters
presetName An ExtendScript File object for the file containing the animation preset.
Returns
Nothing.
Description
Type
String; read/write.
Description
Type
85
JavaScript Reference Layer object
86
Description
Copies the layer into the specified composition. The original layer remains unchanged. Creates a new Layer
object with the same values as this one, and prepends the new object to the l a y e r s collection in the target
CompItem. Retrieve the copy using i n t o C o m p .laye r( 1) .
Copying in a layer changes the index positions of previously existing layers in the target composition. This is
the same as copying and pasting a layer through the user interface.
Parameters
Returns
Nothing.
Description
Duplicates the layer. Creates a new Layer object in which all values are the same as in this one. This has the
same effect as selecting a layer in the user interface and choosing Edit > Duplicate, except the selection in the
user interface does not change when you call this method.
Parameters
None.
Returns
Layer object.
Description
When true, the layer is enabled; otherwise false. This corresponds to the video switch state of the layer in the
Timeline panel.
Type
Boolean; read/write.
Description
When true, the layer has a video switch (the eyeball icon) in the Timeline panel; otherwise false.
86
JavaScript Reference Layer object
87
Type
Boolean; read-only.
Description
Type
Description
Type
Floating-point value in the range [-10800.0..10800.0] (minus or plus three hours); read/write.
Description
True if the value of the n a m e attribute has been set explicitly, rather than automatically from the source.
Type
Boolean; read-only.
Description
When true, the layer is locked; otherwise false. This croplands to the lock toggle in the Layer panel.
Type
Boolean; read/write.
Description
Moves this layer to a position immediately after (below) the specified layer.
87
JavaScript Reference Layer object
88
Parameters
Returns
Nothing.
Description
Moves this layer to a position immediately before (above) the specified layer.
Parameters
Returns
Nothing.
Description
Moves this layer to the topmost position of the layer stack (the first layer).
Parameters
None.
Returns
Nothing.
Description
Moves this layer to the bottom position of the layer stack (the last layer).
Parameters
None.
Returns
Nothing.
88
JavaScript Reference Layer object
89
Description
The name of the layer. By default, this is the same as the Source name (which cannot be changed in the Layer
panel), but you can set it to be different.
Type
String; read/write.
Description
When true, the layer was created as a null object; otherwise false.
Type
Boolean; read-only.
Description
Type
Floating-point value in the range [-10800.0..10800.0] (minus or plus three hours); read/write.
Description
Type
89
JavaScript Reference Layer object
90
Description
Parameters
None.
Returns
Nothing.
Description
An array containing all of the currently selected Property and PropertyGroup objects in the layer.
Type
Description
Sets the parent of this layer to the specified layer, without changing the transform values of the child layer.
There may be an apparent jump in the rotation, translation, or scale of the child layer, as this layer’s transform
values are combined with those of its ancestors.
If you do not want the child layer to jump, set the p a r e n t attribute directly. In this case, an offset is calculated
and set in the child layer's transform fields, to prevent the jump from occurring.
Parameters
Returns
Nothing.
Description
When true, the layer is “shy,” meaning that it is hidden in the Layer panel if the composition’s “Hide all shy
layers” option is toggled on.
90
JavaScript Reference Layer object
91
Type
Boolean; read/write.
Description
Type
Boolean; read/write.
Description
Type
Floating-point value in the range [-10800.0..10800.0] (minus or plus three hours); read/write.
Description
The layer’s time stretch, expressed as a percentage. A value of 100 means no stretch. Values between 0 and 1
are set to 1, and values between -1 and 0 (not including 0) are set to -1.
Type
Description
Type
91
JavaScript Reference LayerCollection object
92
LayerCollection object
a pp .p r o j e c t .i te m (i nd e x) .l ay e r s
Description
The LayerCollection object represents a set of layers. The LayerCollection belonging to a CompItem object
contains all the layer objects for layers in the composition. The methods of the collection object allow you to
manipulate the layer list.
• LayerCollection is a subclass of Collection. All methods and attributes of Collection, in addition to those
listed below, are available when working with LayerCollection. See “Collection object” on page 51.
Example
Given that the first item in the project is a CompItem and the second item is an AVItem, this example shows
the number of layers in the CompItem's layer collection, adds a new layer based on an AVItem in the project,
then displays the new number of layers.
va r f ir st C omp = ap p. pr oje ct .i t em( 1) ;
v a r l a y e r C o l l e c t i o n = f i r s t C o m p. l a y e r s;
a l e r t (" n u m b e r o f l a y e r s b e f o r e i s " + l a y e r C o l l e c t i o n . l e n g t h );
v a r an A V I t e m = ap p .p r o je c t.i t e m ( 2 ) ;
l a ye r C o l l e c t i o n . a dd ( a n A VI t e m ) ;
a l e r t (" n u m b e r o f l a y e r s a f t e r is " + la y e r C o l l e c t i o n . l e n g t h ) ;
Methods
a dd ( ) “LayerCollection add() method” on Creates a new AVLayer and adds it to this collection.
page 93
a dd N u l l ( ) “LayerCollection addNull() method” on Creates a new, null layer and adds it to this collection.
page 94
a dd S ol i d( ) “LayerCollection addSolid() method” on Creates a new layer, a FootageItem with a SolidSource, and adds it
page 94 to this collection.
a dd T ex t () “LayerCollection addText() method” on Creates a new text layer and adds it to this collection.
page 95
a dd C a m era () “LayerCollection addCamera() method” Creates a new camera layer and adds it to this collection.
on page 93
a dd L i g ht () “LayerCollection addLight() method” on Creates a new light layer and adds it to this collection.
page 93
a dd S ha pe () “LayerCollection addShape() method” Creates a new shape layer and adds it to this collection.
on page 94
byName() “LayerCollection byName() method” on Retrieves the layer object with a specified name.
page 95
92
JavaScript Reference LayerCollection object
93
Description
Creates a new AVLayer object containing the specified item, and adds it to this collection.
This method generates an exception if the item cannot be added as a layer to this CompItem.
Parameters
d u r a ti o n Optional, the length of a still layer in seconds, a floating-point value. Used only if the item contains a piece of
still footage. Has no effect on movies, sequences or audio.
If supplied, sets the du rat i on value of the new layer. Otherwise, the d u r a ti o n value is set according to user
preferences. By default, this is the same as the duration of the containing CompItem. To set another preferred
value, choose Edit > Preferences > Import (Windows) or After Effects > Preferences > Import (Mac OS), and spec-
ify options under Still Footage.
Returns
AVLayer object.
Description
Creates a new camera layer and adds the CameraLayer object to this collection.
Parameters
c e n t e r Poi n t The center of the new camera, a floating-point array [x, y]. This is used to set the initial x and y values of the
new camera’s Point of Interest property. The z value is set to 0.
Returns
CameraLayer object.
Description
Creates a new light layer and adds the LightLayer object to this collection.
Parameters
c e n t e r Poi n t The center of the new light, a floating-point array [x, y].
93
JavaScript Reference LayerCollection object
94
Returns
LightLayer object.
Description
Creates a new null layer and adds the AVLayer object to this collection. This is the same as choosing
Layer > New > Null Object.
Parameters
If supplied, sets the du rat i on value of the new layer. Otherwise, the d u r a ti o n value is set according to user
preferences. By default, this is the same as the duration of the containing CompItem. To set another preferred
value, choose Edit > Preferences > Import (Windows) or After Effects > Preferences > Import (Mac OS), and specify
options under Still Footage.
Returns
AVLayer object.
Description
Creates a new ShapeLayer object for a new, empty Shape layer. Use the ShapeLayer object to add properties,
such as shape, fill, stroke, and path filters.
This is the same as using a shape tool in "Tool Creates Shape" mode. Tools automatically add a vector group
that includes Fill and Stroke as specified in the tool options.
Parameters
None
Returns
ShapeLayer object.
Description
Creates a new SolidSource object, with values set as specified; sets the new SolidSource as the m a i n S o u r ce
value of a new FootageItem object, and adds the FootageItem to the project. Creates a new AVLayer object,
sets the new FootageItem as its s o u r c e , and adds the layer to this collection.
Parameters
color The color of the solid, an array of four floating-point values, [R, G, B, A], in the range [0.0..1.0].
94
JavaScript Reference LayerCollection object
95
p i xe l A s pe c t The pixel aspect ratio of the solid, a floating-point value in the range [0.01..100.0].
If supplied, sets the d u r a ti o n value of the new layer. Otherwise, the du rat i on value is set according to
user preferences. By default, this is the same as the duration of the containing CompItem. To set another
preferred value, choose Edit > Preferences > Import (Windows) or After Effects > Preferences > Import (Mac
OS), and specify options under Still Footage.
Returns
AVLayer object.
Description
Creates a new text layer and adds the new TextLayer object to this collection.
Parameters
s o u r ce T e x t Optional; a string containing the source text of the new layer, or a TextDocument object contain-
ing the source text of the new layer. See “TextDocument object” on page 171.
Returns
TextLayer object.
Description
Returns the first (topmost) layer found in this collection with the specified name, or null if no layer with the
given name is found.
Parameters
Returns
95
JavaScript Reference LayerCollection object
96
Description
Creates a new CompItem object and moves the specified layers into its layer collection. It removes the
individual layers from this collection, and adds the new CompItem to this collection.
Parameters
m o v e A l l A t t ri bu te s Optional. When true (the default), retains all attributes in the new composition.
This is the same as selecting the “Move all attributes into the new composition”
option in the Pre-compose dialog box.
You can only set this to false if there is just one index in the l a y e r I n d i ce s array.
This is the same as selecting the “Leave all attributes in” option in the Pre-com-
pose dialog box.
Returns
CompItem object.
96
JavaScript Reference LightLayer object
97
LightLayer object
a pp .p r o j e c t .i te m (i nd e x) .l a y e r( in de x)
Description
The LightLayer object represents a light layer within a composition. Create it using the LayerCollection
object’s a dd L i g ht method; see “LayerCollection addLight() method” on page 93. It can be accessed in an
item’s layer collection either by index number or by a name string.
• LightLayer is a subclass of Layer. All methods and attributes of Layer are available when working with Light-
Layer. See “Layer object” on page 83.
AE Properties
LightLayer defines no additional attributes, but has different AE properties than other layer types. It has the
following properties and property groups:
Ma r k e r
T r a n s f o rm
P oi n t o f In ter es t
P o s i ti o n
S c al e
O r i e n t a t io n
X R o t at io n
Y R o t at io n
Ro ta ti on
O pa c i ty
L i g ht O pt i o n s
Intensity
Co lo r
Cone Angle
C o n e F e a t h er
Ca st s Sh ad ow s
S h a do w D ar k n e ss
S h a do w D i ff u s i o n
97
JavaScript Reference MarkerValue object
98
MarkerValue object
ne w M arkerV alue (c o m m e n t , c h a pt e r , u r l , f r a m eT a r g et , c u e P o i n t N a m e, pa r a m s)
Description
The MarkerValue object represents a layer marker, which associates a comment, and optionally a chapter
reference point, Web-page link, or Flash Video cue point with a particular point in a layer. Create it with the
constructor; all arguments except c o m m e n t are optional. All arguments are strings that set in the corre-
sponding attributes of the returned MarkerValue object, except p ar am s . This is an array containing key-value
pairs., which can then be accessed with the g et Pa ra m et er( ) and s e t Pa r am e te r ( ) methods. A script can set any
number of parameter pairs; the order does not reflect the order displayed in the application.
To associate a marker with a layer, set the MarkerValue object in the Ma rke r AE property of the layer:
layer O bjec t .propert y("M arker " ). set Va l ueA tTime( t i m e , m a rk er Va lue O bj ec t );
For information on the usage of markers see “Using markers” in After Effects Help.
Attributes
chapter “MarkerValue chapter attribute” on A chapter link reference point for the associated layer.
page 99
eventCuePoint “MarkerValue eventCuePoint attribute” Whether the Flash Video cue point is for an event or navigation.
on page 99
ur l “MarkerValue getParameters() method” A URL for Web page to be associated with the layer.
on page 100
f ram eTar get “MarkerValue eventCuePoint attribute” A specific frame target within the Web page specified by u rl .
on page 99
Methods
ge tPara m et ers() “MarkerValue getParameters() method” Retrieves the key-value pairs associated with the marker value.
on page 100
s e t Pa r am e te r s () “MarkerValue setParameters() method” Sets the key-value pairs associated with the marker value.
on page 100
Examples
98
JavaScript Reference MarkerValue object
99
Description
A text chapter link for this marker. Chapter links initiate a jump to a chapter in a QuickTime movie or in other
formats that support chapter marks.
Type
String; read/write.
Description
A text comment for this marker. This comment appears in the Timeline panel next to the layer marker.
Type
String; read/write.
Description
The Flash Video cue point name, as shown in the Marker dialog.
Type
String; read/write.
Description
When t rue , the FlashVideo cue point is for an event; otherwise, it is for navigation.
Type
Boolean; read/write.
99
JavaScript Reference MarkerValue object
100
Description
A text frame target for this marker. Together with the URL value, this targets a specific frame within a Web
page.
Type
String; read/write.
Description
Returns the key-value pairs for Flash Video cue-point parameters, for a cue point associated with this marker
value.
Parameters
None.
Returns
An object with an attribute matching each parameter name, containing that parameter’s value.
Description
Associates a set of key-value pairs for Flash Video cue-point parameters, for a cue point associated with this
marker value. A cue point can have any number of parameters, but you can add only three through the user
interface; use this method to add more than three parameters.
Parameters
k ey Va l u eP ai r s An object containing the key-value pairs as attributes and values. The object’s toS t ri ng( )
method is called to assign the string value of each attribute to the named key.
Returns
Nothing.
Example
v a r m v = n e w M a r k e r V al u e (" M y M ar k e r " ) ;
m v . s e tP a r am e t e r s( p a r m s ) ;
100
JavaScript Reference MarkerValue object
101
m y L a y e r . p r o pe rt y ( " M a r k e r " ) . s e t V a l u e A t T i m e ( 2 , m v ) ;
Description
A URL for this marker. This URL is an automatic link to a Web page.
Type
String; read/write.
101
JavaScript Reference MaskPropertyGroup object
102
MaskPropertyGroup object
a pp .p r o j e c t .i te m (i nd e x) .l ay e r ( inde x) .m as k
Description
Attributes
ro toB ezier “MaskPropertyGroup rotoBezier attribute” When true, the shape of the mask is RotoBezier.
on page 103
ma skMo tionB l ur “MaskPropertyGroup maskMotionBlur How motion blur is applied to this mask.
attribute” on page 103
color “MaskPropertyGroup color attribute” on The color used to draw the mask outline in the user
page 102 interface.
Description
The color used to draw the mask outline as it appears in the user interface (Composition panel, Layer panel,
and Timeline panel).
Type
Array of three floating-point values, [R, G, B], in the range [0.0..1.0]; read/write.
Description
Type
Boolean; read/write.
102
JavaScript Reference MaskPropertyGroup object
103
Description
When true, the mask is locked and cannot be edited in the user interface; otherwise, false.
Type
Boolean; read/write.
Description
Type
Description
Type
Description
Type
Boolean; read/write.
103
JavaScript Reference OMCollection object
104
OMCollection object
a pp.proj ect .render Qu eue .item s. out pu tMo du les
Description
The OMCollection contains all of the output modules in a render queue. The collection provides access to the
OutputModule objects, but does not provide any additional functionality. The first OutputModule object in
the collection is at index position 1. See “OutputModule object” on page 105
• OMCollection is a subclass of Collection. All methods and attributes of Collection are available when
working with OMCollection. See “Collection object” on page 51.
104
JavaScript Reference OutputModule object
105
OutputModule object
a pp.proj ect .render Qu eue .item (i nd e x) .o u t p u t M o d u l e s ( inde x )
Description
An OutputModule object of a RenderQueueItem generates a single file or sequence via a render operation,
and contains attributes and methods relating to the file to be rendered.
Attributes
f i le “OutputModule file attribute” on The path and name of the file to be rendered.
page 105
name “OutputModule name attribute” on The user-interface name of the output module.
page 106
Methods
re move () “OutputModule remove() method” on Removes this output module from the render-queue item’s list.
page 106
Description
Parameters
Returns
Nothing.
Description
The ExtendScript File object for the file this output module is set to render.
105
JavaScript Reference OutputModule object
106
Type
Description
Type
String; read-only.
Description
Type
Description
Parameters
None.
Returns
Nothing.
Description
106
JavaScript Reference OutputModule object
107
Parameters
Returns
Nothing.
Description
The names of all output-module templates availalbe in the local installation of After Effects.
Type
107
JavaScript Reference PlaceholderSource object
108
PlaceholderSource object
a pp .p r o j e c t .i te m (i nd e x) .m a in So u r c e
a pp .p r o j e c t .i te m (i nd e x) . p r o x y S o u r ce
Description
108
JavaScript Reference Project object
109
Project object
a pp .p r o j e c t
Description
The project object represents an After Effects project. Attributes provide access to specific objects within the
project, such as imported files or footage and compositions, and also to project settings such as the timecode
base. Methods can import footage, create solids, compositions and folders, and save changes.
Attributes
f i le “Project file attribute” on page 112 The file for the currently open project.
ro otFo ld er “Project rootFolder attribute” on The folder containing all the contents of the
page 115 project; the equivalent of the Project panel
t im e c o d e F i l m T y p e “Project timecodeFilmType attribute” The film type for the “Feet + Frames” project set-
on page 117 ting.
nu mIte ms “Project numItems attribute” on The total number of items contained in the
page 114 project.
selection “Project selection attribute” on All items selected in the Project panel.
page 116
d i sp l ay S t ar t F r am e “Project displayStartFrame attribute” on The frame at which to start numbering when dis-
page 111 playing the project.
linearBlending “Project linearBlending attribute” on When true, linear blending is used for the project.
page 113
Methods
i te m ( ) “Project item() method” on page 113 Retrieves an item from the project.
109
JavaScript Reference Project object
110
re du ceProje c t() “Project reduceProject() method” on Reduces the project to a specified set of items.
page 114
close() “Project close() method” on page 111 Closes the project with normal save options.
i m p ort Pl a c eho l de r() “Project importFileWithDialog() Imports a placeholder into the project.
method” on page 112
Description
The item that is currently active and is to be acted upon, or a null if no item is currently selected or if multiple
items are selected.
Type
Description
Automatically replaces text found in broken expressions in the project, if the new text causes the expression to
evaluate without errors.
Parameters
Returns
Nothing.
110
JavaScript Reference Project object
111
Description
Type
Description
Closes the project with the option of saving changes automatically, prompting the user to save changes or
closing without saving changes.
Parameters
Returns
Boolean. True on success. False if the file has not been previously saved, the user is prompted, and the user
cancels the save.
Description
Consolidates all footage in the project. Same as the File > Consolidate All Footage command.
Parameters
None.
Returns
111
JavaScript Reference Project object
112
Description
The frame at which to start numbering when displaying the project with a t i m e c o d e D is p l a y T y p e value of
T i m e c o d e D i s p l a yT yp e . F R A M E S . (See “Project timecodeDisplayType attribute” on page 116.) This is the
same as setting “Start numbering frames at:” in the Project Settings > Display Style tab.
Type
Integer; read/write.
Description
The ExtendScript File object for the file containing the project that is currently open.
Type
Description
Imports the file specified in the specified ImportOptions object, using the specified options. Same as the
File > Import File command. Creates and returns a new FootageItem object from the file, and adds it to the
project’s i t e m s array.
Parameters
i m p o r t Op t io n s An ImportOptions object specifying the file to import and the options for the operation. See
“ImportOptions object” on page 73.
Returns
FootageItem object.
Example
a pp .p r o j e c t .i m po r tF i l e ( n e w I m p or tO pt i o n s (F i l e ( “ s am p l e .p s d” ) )
Description
Shows an Import File dialog box. Same as the File > Import > File command.
Returns
Array of Item objects created during import; or null if the user cancels the dialog.
112
JavaScript Reference Project object
113
Description
Creates and returns a new PlaceholderItem object and adds it to the project’s i te m s array. Same as the
File > Import > Placeholder command.
Parameters
f r am e R a te The frame rate of the placeholder, a floating-point value in the range [1.0..99.0]
d u r a ti o n The duration of the placeholder in seconds, a floating-point value in the range [0.0..10800.0].
Returns
PlaceholderItem object.
Description
Parameters
index The index position of the item, an integer. The first item is at index 1.
Returns
Item object.
Description
Type
Description
True if linear blending should be used for this project; othewise false.
113
JavaScript Reference Project object
114
Type
Boolean; read/write.
Description
The total number of items contained in the project, including folders and all types of footage.
Type
Integer; read-only.
Example
n = ap p .p r o je c t.n u m I t e m s ;
a l ert ("Th ere a re " + n + " it ems in th is proj ect. ")
Description
Removes all items from the project except those specified. Same as the File > Reduce Project command.
Parameters
a rra y_o f_it ems An array containing the Item objects that are to be kept.
Returns
Example
v a r t he I t em s = n ew A r r a y ( ) ;
t heI t em s [ th eI te m s .l en g t h] = a pp .p ro jec t .i te m (1 );
t heI t em s [ th eI te m s .l en g t h] = a pp .p ro jec t .i te m (3 );
a pp .p r o j e c t .r e d u c e Pr o je c t (t h e I te m s) ;
Description
Removes unused footage from the project. Same as the File > Remove Unused Footage command.
Parameters
None.
Returns
114
JavaScript Reference Project object
115
Description
Type
Description
The root folder containing the contents of the project; this is a virtual folder that contains all items in the
Project panel, but not items contained inside other folders in the Project panel.
Type
Description
Saves the project. The same as the File > Save or File > Save As command. If the project has never previously
been saved and no file is specified, prompts the user for a location and file name. Pass a File object to save a
project to a new file without prompting.
Parameters
Returns
None.
Description
Shows the Save dialog box. The user can name a file with a location and save the project, or click Cancel to exit
the dialog.
Parameters
None.
115
JavaScript Reference Project object
116
Returns
Description
All items selected in the Project panel, in the sort order shown in the Project panel.
Type
Description
Parameters
doShow When true, show the Project panel. When false, hide the Project panel.
Returns
Nothing.
Description
The Timecode Base option, as set in the Project Settings dialog box.
Type
116
JavaScript Reference Project object
117
Description
The way in which timecode is set to display, as set in the Project Settings dialog box.
Type
Description
The film type, as set in the Feet + Frames option in the Project Settings dialog box.
Type
Description
How timecode for 29.97 fps footage is displayed, as set in the Project Settings dialog box under NTSC.
Type
Boolean, true for the Drop Frame option, false for the Non-Drop Frame option; read/write.
Description
Type
Boolean; read/write.
117
JavaScript Reference Property object
118
Property object
a pp .p r o j e c t .i te m (i nd e x) .l ay e r ( inde x) .p r op e r t y S p ec
Description
The Property object contains value, keyframe, and expression information about a particular AE property of
a layer. An AE property is an value, often animatable, of an effect, mask, or transform within an individual
layer. For examples of how to access properties, see “PropertyBase object” on page 140 and “PropertyGroup
property() method” on page 149.
• PropertyGroup is a subclass of PropertyBase. All methods and attributes of PropertyBase, in addition to
those listed below, are available when working with PropertyGroup. See “PropertyBase object” on
page 140.
NOTE: JavaScript objects commonly referred to as “properties” are called “attributes” in this guide, to avoid
confusion with the After Effects definition of property.
Attributes
va lue “Property value attribute” on page 138 Current value of the property.
h as Max “Property hasMax attribute” on When true, there is a maximum permitted value.
page 123
i s Sp a t i a l “Property isSpatial attribute” on When true, the property defines a spatial value.
page 124
un it sT ext “Property unitsText attribute” on A text description of the units in which the value is
page 138 expressed.
c an Se tE x p r e s s io n “Property canSetExpression attribute” When true, the expression can be set by a script.
on page 122
e x p r e ss i o n E n a b l e d “Property expressionEnabled attribute” When true, the expression is used to generate val-
on page 123 ues for the property.
e x p r e ss i o n E r r o r “Property expressionError attribute” on The error, if any, that occurred when the last expres-
page 123 sion was evaluated.
118
JavaScript Reference Property object
119
Methods
valueAtTime() “Property valueAtTime() method” on Gets the value of the property evalu-
page 139 ated at given time.
s e t V al u e ( ) “Property setValue() method” on page 137 Sets the static value of the property.
k ey T i m e( ) “Property keyTime() method” on page 129 Gets the time at which a condition
occurs.
k ey Va l u e( ) “Property keyValue() method” on page 130 Gets the value of a keyframe at the time
at which a condition occurs.
a dd K ey ( ) “Property addKey() method” on page 122 Adds a new keyframe to the property at
a given time.
re move Key() “Property removeKey() method” on Removes a keyframe from the property.
page 132
keyInInterpolationType() “Property keyInInterpolationType() method” Gets the 'in' interpolation type for a key.
on page 125
k e y I n S p a t ia l T a n g e n t ( ) “Property keyInSpatialTangent() method” on Gets the “in” spatial tangent for a key.
page 125
k eyO utS p at ialTan gent () “Property keyOutSpatialTangent() method” Gets the “out” spatial tangent for a key.
on page 126
setTemporalEaseAtKey() “Property setTemporalEaseAtKey() method” Sets the “in” and “out” temporal ease for
on page 136 a key.
119
JavaScript Reference Property object
120
k ey I n T e m po r al E a s e() “Property keyInTemporalEase() method” on Gets the “in” temporal ease for a key.
page 126
k ey O u tT em p o r a lE as e( ) “Property keyOutTemporalEase() method” Gets the “out” temporal ease for a key.
on page 127
keyTem por alCon tinuou s() “Property keyTemporalContinuous() Reports whether a keyframe has tem-
method” on page 129 poral continuity.
k eyTem por alAu toB ezier () “Property keyTemporalAutoBezier() Reports whether a keyframe has tem-
method” on page 129 poral auto-Bezier.
120
JavaScript Reference Property object
121
m y S h a pe .c l o s e d = f a l s e ;
myProperty.setValue(myShape);
A color is stored as an array of four floats, [r,g,b,opacity]. This sets the value of the red component of a light's
color at time 4 to be half of that at time 2:
va r myP rop er ty = m yL igh t. color;
va r color Valu e = m yP ro pe rty. value At Tim e( 2,t rue );
c o l o r V a l u e [ 0 ] = 0 . 5 * c o l o r V a l u e [0 ];
myProperty.setValueAtTime(4,colorValue);
Example: Check that a scale calculated by an expression at time 3.5 is the expected value of [10,50]
va r myProper ty = m yL ayer. sca l e;
/ / f a l s e v a l u e o f p r e E x p r e s s i o n m e a n s e v a l u at e t h e e x p r e s s i o n
va r s c aleV alue = myP rop er ty.v alueA tTime (3 .5,f a ls e) ;
i f ( s c a l e V al u e [0 ] = = 1 0 & & s c a l e V a l u e [ 1 ] = = 5 0 ) {
a l ert ("h urra y");
}
else {
a l ert (" oo ps " ) ;
}
The animation is 10 seconds, and the middle keyframe is at the 5 second mark. Rotation properties are stored
as a OneD value.
m y P r o p e r t y = m y L a y e r .r o t a t i o n ;
m y P r o p e r t y . s e t V a l u e A t T i m e ( 0 , 0 );
m y P r o p e r t y . s e t V a l u e A t T i m e ( 5 , 9 0) ;
myProperty.setValueAtTime(10, 0);
Example: Change the keyframe values for the first three keyframes of some source text
m y P r o p e r t y = m y T e x t L a y e r . s o u r c e T e xt ;
i f (m y P r o p e r t y . n u m K e y s < 3 ) {
a l ert ("er ror, I th ough t t her e w ere 3 ke yfra mes");
}
else {
myProper ty.set Va lueAt K ey(1, ne w T e x t D o c u m e n t( " k e y n um b e r 1 " ) ) ;
myProper ty.set Va lueAt K ey(2, ne w T e x t D o c u m e n t( " k e y n um b e r 2 " ) ) ;
myProper ty.set Va lueAt K ey(3, ne w T e x t D o c u m e n t( " k e y n um b e r 3 " ) ) ;
}
Example: Set values using the convenience syntax for position, scale, color, or source text
// Th ese tw o a re eq uiva lent . The se co nd fi l l s i n a de fa ul t o f 0 .
m y L a y e r . p o s i t i o n . se tV al u e ([ 2 0 , 3 0 , 0 ] ) ;
m y L a y e r . p o s i t i o n . se tV al u e ([ 2 0 , 3 0 ] ) ;
// Th ese tw o a re eq uiva lent . The se co nd fi l l s i n a de fa ul t o f 1 00.
myLa yer.scale .setV alue ([50 , 50 , 100 ]);
m y L a y e r .s c al e .s e tV al u e ([ 5 0 , 5 0 ]) ;
// Th ese tw o a re eq uiva lent . The se co nd fi l l s i n a de fa ul t o f 1 .0
121
JavaScript Reference Property object
122
Description
Adds a new keyframe or marker to the named property at the specified time and returns the index of the new
keyframe.
Parameters
t im e The time, in seconds, at which to add the keyframe. A floating-point value. The beginning of the composition is 0.
Returns
Description
When true, the named property is of a type whose expression can be set by a script. See also “Property
expression attribute” on page 122.
Type
Boolean; read-only.
Description
When true, the named property can vary over time—that is, keyframe values or expressions can be written to
this property.
Type
Boolean; read-only.
Description
The expression for the named property. Writeable only when canSet Expr ession for the named property is
true. When you specify a value for this attribute, the string is evaluated.
122
JavaScript Reference Property object
123
Type
Description
When true, the named property uses its associated expression to generate a value. When false, the keyframe
information or static value of the property is used. This attribute can be set to true only if c a n Se tE x p re ss i on
for the named property is true and expr ession contains a valid expression string.
Type
Boolean; read/write.
Description
Contains the error, if any, generated by evaluation of the string most recently set in expr ession . If no
expression string has been specified, or if the last expression string evaluated without error, contains the
empty string ("").
Type
String; read-only.
Description
When true, there is a maximum permitted value for the named property; otherwise false.
Type
Boolean; read-only.
Description
When true, there is a minimum permitted value for the named property; otherwise false.
123
JavaScript Reference Property object
124
Type
Boolean; read-only.
Description
Returns true if the named property can be interpolated using the specified keyframe interpolation type.
Parameters
K e y f r a m e I n t er p o l a ti o n T y p e . L I N E A R
K e y f r a m e I n t er p o l a ti o n T y p e . B E Z I E R
K e y f r a m e I n t er p o l a ti o n T y p e . H O L D
Returns
Boolean.
Description
When true, the named property defines a spatial value. Examples are position and effect point controls.
Type
Boolean; read-only.
Description
When true, the named property is time varying—that is, it has keyframes or an enabled expression. When this
attribute is true, the attribute c a n V a r y O v e r T im e must also be true.
Type
Boolean; read-only.
Description
124
JavaScript Reference Property object
125
Type
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the ad d K e y or n e a r e s t K e y -
I n d e x method.
Returns
Description
Returns the incoming spatial tangent for the specified keyframe, if the named property is spacial (that is, the
value type is T w o D _ SP A T I A L or T hree D_ S P AT I AL ).
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the ad d K e y or n e a r e s t K e y -
I n d e x method.
Returns
125
JavaScript Reference Property object
126
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
126
JavaScript Reference Property object
127
Returns
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Description
Returns true if the specified keyframe is roving. The first and last keyframe in a property cannot rove; if you
try to set roving for one of these, the operation is ignored, and k ey R o v i n g ( ) continues to return false.
If the property value type is neither T w o D_ S P A T I A L nor T h r e e D_ S P A T I A L , an exception is generated.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Boolean.
127
JavaScript Reference Property object
128
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Boolean.
Description
Returns true if the specified keyframe has spatial auto-Bezier interpolation. (This type of interpolation affects
this keyframe only if ke ySpat i alCo ntinuo us( keyInd ex ) is also true.)
If the property value type is neither T w o D_ S P A T I A L nor T h r e e D_ S P A T I A L , an exception is generated.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Boolean.
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Boolean.
128
JavaScript Reference Property object
129
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Boolean.
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Boolean.
Description
Finds the specified keyframe or marker and returns the time at which it occurs.
If no keyframe or marker can be found that matches the argument, this method generates an exception, and
an error is displayed.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the ad dKe y or near -
e st K ey I n d ex method.
markerComment The comment string attached to a marker (see “MarkerValue comment attribute” on page 99).
129
JavaScript Reference Property object
130
Returns
Floating-point value.
Description
Finds the specified keyframe or marker and returns its current value.
If no keyframe or marker can be found that matches the argument, this method generates an exception, and
an error is displayed.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the ad dKe y or near -
e st K ey I n d ex method.
markerComment The comment string attached to a marker (see “MarkerValue comment attribute” on page 99).
Returns
Floating-point value.
Description
The maximum permitted value of the named property. If the hasMa x attribute is false, an exception occurs,
and an error is generated.
Type
Description
The minimum permitted value of the named property. If the ha sM in attribute is false, an exception occurs,
and an error is generated.
Type
130
JavaScript Reference Property object
131
Description
Parameters
Returns
Integer.
Description
The number of keyframes in the named property. If the value is 0, the property is not being keyframed.
Type
Integer; read-only.
Description
The position index of the named property. The first property is at index position 1.
Type
Integer; read-only.
Description
The type of value stored in the named property. The Pr ope rty V al ue T y pe enumeration has one value for each
type of data that can be stored in or retrieved from a property. Each type of data is stored and retrieved in a
different kind of structure. All property objects store data according to one of these categories.
For example, a 3D spatial property (such as a layer's position) is stored as an array of three floating point
values. When setting a value for position, pass in such an array, as follows:
my l a ye r.p rop er ty ( " po si t io n "). se tVa lue([10, 20, 0]);
In contrast, a shape property (such as a layer's mask shape) is stored as a Shape object. When setting a value
for a shape, pass a Shape object, as follows:
v a r m y S h a pe = n e w S h a p e () ;
131
JavaScript Reference Property object
132
mySha pe .ve rtices = [[0,0 ], [0 ,10 0], [1 00, 100 ], [10 0,0 ]];
v a r m y M a s k = m y l a y e r .p r o p e r t y ( " A DBE Mask Pa rade").pro pe rty(1);
m y M as k. pr o pe r ty ( " A D BE M as k S h ap e " ) .s e tV al u e (m y S h a p e ) ;
Type
PropertyValueType.COLOR Array of 4 floating-point values in the range [0.0..1.0]. For example, [0.8,
0.3, 0.1, 1.0]
P r o p e r t y V a l u e T y p e . C U S T O M_ V A L U E Unimplemented type; you cannot get or set values for properties with this
type.
Proper tyVa lueType. SH APE Shape object; see “Shape object” on page 164.
Description
Removes the specified keyframe from the named property. If no keyframe with the specified index exists,
generates an exception and displays an error.
When a keyframe is removed, the remaining index numbers change. To remove more than one keyframe, you
must start with the highest index number and work down to the lowest to ensure that the remaining indices
reference the same keyframe after each removal.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Nothing.
132
JavaScript Reference Property object
133
Description
The indices of all the selected keyframes in the named property. If no keyframes are selected, or if the property
has no keyframes, returns an empty array.
Type
Description
Sets the ‘in’ and ‘out’ interpolation types for the specified keyframe.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a d dK ey
or n e a re s t K e y I n d e x method.
K e y f r a m e I n t er p o l a ti o n T y p e . L I N E A R
K e y f r a m e I n t er p o l a ti o n T y p e . B E Z I E R
K e y f r a m e I n t er p o l a ti o n T y p e . H O L D
outType (Optional) The outgoing interpolation type. If not supplied, the ‘out’ type is set to the i n T y p e
value. A K e y f r a m e I n t er p o l a ti o n T y p e enumerated value; one of:
K e y f r a m e I n t er p o l a ti o n T y p e . L I N E A R
K e y f r a m e I n t er p o l a ti o n T y p e . B E Z I E R
K e y f r a m e I n t er p o l a ti o n T y p e . H O L D
Returns
Nothing.
Description
Turns roving on or off for the specified keyframe. The first and last keyframe in a property cannot rove; if you
try to set roving for one of these, the operation is ignored, and k ey R o v i n g ( ) continues to return false.
If the property value type is neither T w o D_ S P A T I A L nor T h r e e D_ S P A T I A L , an exception is generated.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a d dK ey or n e a r e s t Ke y -
In de x method.
133
JavaScript Reference Property object
134
Returns
Nothing.
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Nothing.
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Nothing.
Description
134
JavaScript Reference Property object
135
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Nothing.
Description
Sets the incoming and outgoing tangent vectors for the specified keyframe.
If the property value type is neither T w o D_ S P A T I A L nor T h r e e D_ S P A T I A L , an exception is generated.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Nothing.
Description
Turns temporal auto-Bezier interpolation on or off for the specified keyframe. When this is turned on, it
affects this keyframe only if ke ySpa tialCo ntinuo us(k ey I nd e x) is also true.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Nothing.
135
JavaScript Reference Property object
136
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
Returns
Nothing.
Description
Sets the incoming and outgoing temporal ease for the specified keyframe. See “KeyframeEase object” on
page 81.
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or ne ar-
estKe yI n de x method.
• If the property value type is Pro pe rty V al ue T y pe .T w oD_ S P AT I A L , the array contains 2
objects.
• If the property value type is Pro pe rty V al ue T y pe .T hr eeD _ SP AT I AL , the array contains 3
objects.
• If the property value type is Pro pe rty V al ue T y pe .T hr eeD _ SP AT I AL , the array contains 3
objects.
Returns
Nothing.
136
JavaScript Reference Property object
137
Description
Parameters
ne wV alue A value appropriate for the type of property being set; see “Property propertyValueType attribute” on page 131.
Returns
Nothing.
Description
Parameters
k ey I n d ex The index for the keyframe. An integer in the range [1..numKeys], as returned by the a dd K ey or near est-
Ke y I n d ex method.
ne wV alue A value appropriate for the type of property being set; see “Property propertyValueType attribute” on
page 131.
Returns
Nothing.
Description
Sets the value of a keyframe at the specified time. Creates a new keyframe for the named property, if one does
not currently exist for the specified time, and sets its value.
Parameters
ne wV alue A value appropriate for the type of property being set; see “Property propertyValueType
attribute” on page 131.
137
JavaScript Reference Property object
138
Returns
Nothing.
Description
Sets values for a set of keyframes at specified of times. Creates a new keyframe for the named property, if one
does not currently exist for a specified time, and sets its value.
Times and values are expressed as arrays; the arrays must be of the same length.
Parameters
t im es An array of times, in seconds. Each time is a floating-point value. The beginning of the compo-
sition is 0.
ne wV alue s A array of values appropriate for the type of property being set; see “Property propertyValue-
Type attribute” on page 131.
Returns
Nothing.
Description
Type
String; read-only.
Description
Type
A value appropriate for the type of the property (see “Property propertyValueType attribute” on page 131);
read-only.
138
JavaScript Reference Property object
139
Description
Parameters
p r e E xp r e ss i o n If the property has an expression and this is true, return the value for the specified time without
applying the expression to it. When false, return the result of evaluating the expression for the
specified time.
Returns
A value appropriate for the type of the property (see “Property propertyValueType attribute” on page 131).
139
JavaScript Reference PropertyBase object
140
PropertyBase object
a pp .p r o j e c t .i te m (i nd e x) .l ay e r ( inde x) .p r op e r t y S p ec
Description
Properties are accessed by name through layers, using various kinds of expression syntax, as controlled by
application preferences. For example, the following are all ways of access properties in the Effects group:
va r effect1 = a pp.pro ject .item (1 ).la yer( 1 ) . e f f e c t ( " A d d G r a i n " ) ( " V i e w in g M o d e " ) ;
v a r e f f e c t1 ag a in = ap p .p r o j e c t. it e m ( 1) .la yer( 1) .ef f ect. ad d Gr ain.v ie wingM od e;
v a r e f f e c t1 ag a in to o = ap p .p r o j e c t. it e m ( 1 ) .l a y e r ( 1 ) (" E f f e c ts " ) .a dd G r ai n . v i e w in g M o d e ;
v a r e f f e c t1 ag a in to o 2 = a pp .p r o je c t .i te m (1 ). l ay er ( 1 ) ( " E ff e c t s" ) ( " A d d G r a i n " )( " V i e w i n g M o de " );
Reference invalidation
When something occurs that changes an object sufficiently for the reference to become invalid, script refer-
ences to that object can generate errors. In simple cases this is straightforward. For example, if you delete an
object, a reference to the deleted object generates the warning "Object is Invalid":
v a r l ay e r 1 = ap p .p r o je c t.i t e m ( 1 ) .l ay e r (1 );
la ye r1. remov e();
a l ert (l a ye r1. n am e ); / / i n v al i d r ef eren ce to d ele ted obj ect
A less straightforward case is when a property is removed from a property group. In this case, After Effects
generates the "Object is Invalid" error when you subsequently reference that item or other items in the group,
because their index positions have changed. For example:
v a r e f f e c t1 = a pp .p r o je c t .i te m (1 ).l a y e r ( 1 ) .ef f e c t (1) ;
v a r e f f e c t2 = a pp .p r o je c t .i te m (1 ).l a y e r ( 1 ) .ef f e c t (2) ;
va r effect2 pa ram = a pp.proj ect. item (1 ) .l a y e r ( 1 ) .ef f e c t( 2 ) .b l e n dW i t hO r i g i n al ;
e f f e c t1 .r e m o v e () ;
a l e r t (e ff e c t 2 .n a m e ) ; / / i n v a li d r e f e r e n c e b e ca u s e g r o u p in de x p o s i ti o n s h a v e c h an g e d
Attributes
matchName “PropertyBase matchName attribute” A special name for the property used to build unique naming paths.
on page 143
140
JavaScript Reference PropertyBase object
141
p r o p e r ty I n d e x “PropertyBase propertyIndex attribute” Index of this property within its parent group.
on page 145
p r o p e r ty De pt h “PropertyBase propertyDepth attribute” The number of levels of parent groups between this property and
on page 144 the containing layer.
i s M o d i fi e d “PropertyBase isModified attribute” on When true, the property has been changed since its creation.
page 143
c a n Se t E n a b l e d “PropertyBase canSetEnabled attribute” When true, the user interface displays an eyeball icon for this prop-
on page 142 erty.
elided “PropertyBase elided attribute” on When true, this property is not displayed in the user interface.
page 142
Methods
moveTo() “PropertyBase moveTo() method” on Moves this property to a new position in its parent group.
page 144
Description
When true, this property is active. For a layer, this corresponds to the setting of the eyeball icon. For an effect
and all properties, it is the same as the e n a b l e d attribute.
Type
141
JavaScript Reference PropertyBase object
142
Description
When true, you can set the ena b led attribute value. Generally, this is true if the user interface displays an
eyeball icon for this property; it is true for all layers.
Type
Boolean; read-only.
Description
If this property is a child of an indexed group, creates and returns a new PropertyBase object with the same
attribute values as this one.
If this property is not a child of an indexed group, the method generates an exception and displays an error.
An indexed group has the type P r o p e r t y T y p e . I N D E X E D _ G R O U P ; see “PropertyBase propertyType
attribute” on page 145.
Parameters
None.
Returns
PropertyBase object.
Description
When true, this property is a group used to organize other properties. The property is not displayed in the
user interface and its child properties are not indented in the Timeline panel.
For example, for a text layer with two animators and no properties twirled down, you might see:
T e xt
P at h O pt i o n s
Mo re O p tions
An ima to r 1
An ima to r 2
In this example, “Animator 1” and “Animator 2” are contained in a PropertyBase called “Text Animators.”
This parent group is not displayed in the user interface, and so the two child properties are not indented in
the Timeline panel.
Type
Boolean; read-only.
142
JavaScript Reference PropertyBase object
143
Description
When true, this property is enabled. It corresponds to the setting of the eyeball icon, if there is one; otherwise,
the default is true.
Type
Description
Type
Boolean; read-only.
Description
Type
Boolean; read-only.
Description
When true, this property has been changed since its creation.
Type
Boolean; read-only.
Description
A special name for the property used to build unique naming paths. The match name is not displayed, but you
can refer to it in scripts. Every property has a unique match-name identifier. Match names are stable from
version to version regardless of the display name (the n am e attribute value) or any changes to the application.
Unlike the display name, it is not localized.
143
JavaScript Reference PropertyBase object
144
An indexed group may not have a n a m e value, but always has a m a t c h N a m e value. (An indexed group has the
type P r o p e r t y T y p e . I N D E X E D _ G R O U P ; see “PropertyBase propertyType attribute” on page 145.)
Type
String; read-only.
Description
Parameters
ne wIndex The new index position at which to place this property in its group. An integer.
Returns
Nothing.
Description
The display name of the property. (Compare “PropertyBase matchName attribute” on page 143.)
It is an error to set the nam e value if the property is not a child of an indexed group (that is, a property group
that has the type P r o pe rt y T y p e . I N D E X E D _ GR OU P ; see “PropertyBase propertyType attribute” on
page 145).
Type
Description
The property group that is the immediate parent of this property, or null if this PropertyBase is a layer.
Type
144
JavaScript Reference PropertyBase object
145
Description
The number of levels of parent groups between this property and the containing layer. The value 0 for a layer.
Type
Integer; read-only.
Description
Gets the PropertyGroup object for an ancestor group of this property at a specified level of the parent-child
hierarchy.
Parameters
countUp Optional. The number of levels to ascend within the parent-child hierarchy. An integer in the
range [1..pr ope rt yD ep th ]. Default is 1, which gets the immediate parent.
Returns
Description
The position index of this property within its parent group, if it is a child of an indexed group (a property
group that has the type Pr op ert yT yp e. I NDE XED _ G RO UP ; see “PropertyBase propertyType attribute” on
page 145).
Type
Integer; read-only.
Description
Type
PropertyType.INDEXED_GROUP A property group whose members have an editable name and an index. Effects
and masks are indexed groups. For example, the m a s k s property of a layer
refers to a variable number of individual masks by index number.
145
JavaScript Reference PropertyBase object
146
P r o p e r ty T y p e .N A M E D _ GR OU P A property group in which the member names are not editable. Layers are
named groups.
Description
Removes this property from its parent group. If this is a property group, it removes the child properties as well.
This method is valid only for children of indexed groups; if it is not, or if the index value is not valid, the
method generates an exception and displays an error. (An indexed group has the type P r o p e r -
t y T y p e . I N D E X E D _ G R O U P ; see “PropertyBase propertyType attribute” on page 145.)
This method can be called on a text animation property (that is, any animator that has been set to a text layer).
Parameters
None.
Returns
Nothing.
Description
When true, this property is selected. Set to true to select the property, or to false to deselect it.
Sampling this attribute repeatedly for a large number of properties can slow down system performance. To
read the full set of selected properties of a composition or layer, use the s e l e c t e d P r o p e r t ie s attribute of a
Comp or Layer object.
Type
146
JavaScript Reference PropertyGroup object
147
PropertyGroup object
a pp .p r o j e c t .i te m (i nd e x) .l ay e r ( inde x) .p r op e r t y G r oup S p e c
Description
The PropertyGroup object represents a group of properties. It can contain Property objects and other
PropertyGroup objects. Property groups can be nested to provide a parent-child hierarchy, with a Layer object
at the top (root) down to a single Property object, such as the mask feather of the third mask. To traverse the
group hierarchy, use PropertyBase methods and attributes; see “PropertyBase propertyGroup() method” on
page 145.
For examples of how to access properties and property groups, see “PropertyBase object” on page 140.
• PropertyGroup is a subclass of PropertyBase. All methods and attributes of PropertyBase, in addition to
those listed below, are available when working with PropertyGroup. See “PropertyBase object” on
page 140.
• PropertyGroup is a base class for MaskPropertyGroup. PropertyGroup attributes and methods are available
when working with mask groups. See “MaskPropertyGroup object” on page 102.
Attributes
n u m P r op e r t ie s “PropertyGroup numProperties attribute” on page 148 The number of indexed properties in the group.
Methods
c an A d dP r o p e r ty ( ) “PropertyGroup canAddProperty() method” Reports whether a property can be added to the group.
on page 148
Description
Creates and returns a PropertyBase object with the specified name, and adds it to this group.
In general, you can only add properties to an indexed group (a property group that has the type
P r o p e r t y T y p e . I N D E X E D _ G R O U P ; see “PropertyBase propertyType attribute” on page 145) The only
exception is a text animator property, which can be added to a named group (a property group that has the
type P r o p e r ty T y p e .N A M E D _ GR OU P) .
If this method cannot create a property with the specified name, it generates an exception. To check that you
can add a particular property to this group, call c a n A dd P r o p e r t y before calling this method. (See “Property-
Group canAddProperty() method” on page 148.)
147
JavaScript Reference PropertyGroup object
148
Parameters
name The display name or match name of the property to add. (See “PropertyBase matchName attribute” on page 143).
• Any match name for a property that can be added through the user interface. For example, “ADBE Mask Atom”,
“ADBE Paint Atom”, “ADBE Text Position”, “ADBE Text Anchor Point”.
Returns
PropertyBase object.
Description
Returns true if a property with the given name can be added to this property group. For example, you can only
add mask to a mask group. The only legal input arguments are “mask” or “ADBE Mask Atom”.
m a sk G r o u p. c an A d d Pr o p e r t y (" m a sk " ) ; / / r e tu r n s t r u e
m a sk G r o u p. c an A d d Pr o p e r t y (" A DBE M a s k A t o m " ) ; / / r e t u r n s t r u e
m a sk G r o u p. c an A d d Pr o p e r t y (" b len d"); // re tur n s false
Parameters
name The display name or match name of the property to be checked. (See “PropertyGroup addProp-
erty() method” on page 147).
Returns
Boolean.
Description
Type
Integer; read-only.
148
JavaScript Reference PropertyGroup object
149
Description
Finds and returns a child property of this group, as specified by either its index or name.
A name specification can use the same syntax that is available with expressions. The following are all allowed
and are equivalent:
m y l a ye r .p o s i ti o n
m y l a ye r ( " po si ti o n " )
my l a ye r.p rop er ty ( " po si t io n ")
m y l a ye r ( 1 )
m y l a ye r . p r o p e r t y ( 1 )
Some properties of a layer, such as position and zoom, can be accessed only by name.
When using the name to find a property that is multiple levels down, you must make more than one call to
this method. For example, the following call searches two levels down, and returns the first mask in the mask
group:
m y L a y e r .p r o pe r ty ( " A D BE M as ks " ) .p r o p e r t y (1 )
Parameters
index The index for the child property, in this is an indexed group. An integer in the range [0..n u m P r o p e r -
t i es ].
Returns
PropertyBase object or null if no child property with the specified string name is found.
149
JavaScript Reference PropertyGroup object
150
• "Position" or "position"
• "Scale" or "scale"
• "Rotation" or "rotation"
• "Opacity" or "opacity"
• "Marker" or "marker"
• "Aperture" or "aperture"
• "Color" or "color"
• "Ambient" or "ambient"
• "Diffuse" or "diffuse"
• "Specular" or "specular"
• "Shininess" or "shininess"
• "Metal" or "metal"
From a camera, light or 3D layer • "X Rotation" or "xRotation" or "Rotation X" or "rotationX"
• "Orientation" or "orientation"
150
JavaScript Reference PropertyGroup object
151
Examples
1 If a layer named “myLayer” has a Box Blur effect, you can retrieve the effect in any of the following ways:
m y L a y e r .p r o pe r ty ( “ E f fe c ts ” ). p r o p e r t y (“ B o x Bl u r ” );
m y L a y e r .p r o pe r ty ( “ E f fe c ts ” ). p r o p e r t y (“ b o xB l u r ” ) ;
m y L a y e r .p r o pe r ty ( “ E f fe c ts ” ). p rop ert y (“ A DB E Box B lu r” ) ;
2 If a layer named “myLayer” has a mask named “Mask 1” you can retrieve it as follows:
m y L a y e r .p r o pe r ty ( “ M a sk s ” ). pr o p e r t y (“ M as k 1 ” );
3 To get a Bulge Center value from a Bulge effect, you can use either of the following:
m y L a y e r .p r o pe r ty ( “ E f fe c ts ” ). p r o p e r t y(“B ulge”).pro pe rty(“Bu lg e Cent er” );
m y L a y e r .p r o pe r ty ( “ E f fe c ts ” ). p r o p e r t y( “ B ul g e ” ) . p r o pe rt y ( “ b u l g e C e n t e r ” ) ;
151
JavaScript Reference RenderQueue object
152
RenderQueue object
a pp.proj ect .render Qu eue
Description
The RenderQueue object represents the render automation process, the data and functionality that is available
through the Render Queue panel of a particular After Effects project. Attributes provide access to items in the
render queue and their render status. Methods can start, pause, and stop the rendering process.
The RenderQueueItem object provides access to the specific settings for an item to be rendered. See “Render-
QueueItem object” on page 155.
Attributes
re nde ring “RenderQueue rendering attribute” on page 154 When true, a render is in progress.
nu mIte ms “RenderQueue numItems attribute” on page 153 The total number of items in the render queue.
i te m s “RenderQueue items attribute” on page 153 The collection of items in the render queue.
Methods
showWindow() “RenderQueue showWindow() method” Show or hides the Render Queue panel.
on page 154
r e n d e r( ) “RenderQueue render() method” on Starts the rendering process; does not return until render is
page 153 complete.
Description
Parameters
index The position index of the item. An integer in the range [0..n um I tem s ].
Returns
RenderQueueItem object.
152
JavaScript Reference RenderQueue object
153
Description
A collection of all items in the render queue. See “RenderQueueItem object” on page 155.
Type
Description
Type
Integer; read-only.
Description
Pauses the current rendering process, or continues a paused rendering process. This is the same as clicking
Pause in the Render Queue panel during a render. You can call this method from an o n S t a t u s C h a n g e d or
onE rror callback. See “RenderQueueItem onStatusChanged attribute” on page 157 and “Application onError
attribute” on page 26.
Parameters
Returns
Nothing.
Description
Starts the rendering process. This is the same as clicking Render in the Render Queue panel. The method does
not return until the render process is complete. To pause or stop the rendering process, call p a u se R e n d e r i n g ( )
or s t o pR e n d e r i n g ( ) from an onEr ror or onS t at usC han ged callback.
• To respond to errors during the rendering process, define a callback function in ap p .o n E r r o r ; see “Appli-
cation onError attribute” on page 26.
• To respond to changes in the status of a particular item while the render is progressing, define a callback
function in R enderQ ueu eIt em.o n Sta tusCha n ged in the associated RenderQueueItem object; see “Render-
QueueItem onStatusChanged attribute” on page 157.
153
JavaScript Reference RenderQueue object
154
Parameters
None.
Returns
Nothing.
Description
When true, the rendering process is in progress or paused. When false, it is stopped.
Type
Boolean; read-only.
Description
Parameters
doShow When true, show the Render Queue panel. When false, hide it.
Returns
Nothing.
Description
Stops the rendering process. This is the same as clicking Stop in the Render Queue panel during a render. You
can call this method from an o n S t a t u s C h a n g e d or onErr or callback. See “RenderQueueItem onStatus-
Changed attribute” on page 157 and “Application onError attribute” on page 26.
Parameters
None.
Returns
Nothing.
154
JavaScript Reference RenderQueueItem object
155
RenderQueueItem object
a pp.proj ect .render Qu eue .item s( i n d ex )
Description
The RenderQueueItem object represents an individual item in the render queue. It provides access to the
specific settings for an item to be rendered. Create the object by adding a composition to the Render Queue
with the RQItemCollection object; see “RQItemCollection add() method” on page 161.
Attributes
re nde r “RenderQueueItem render attribute” on When true, this item is rendered when the queue is
page 158 started.
s ta r tT im e “RenderQueueItem startTime attribute” on The time when rendering began for the item.
page 159
elapsedSeconds “RenderQueueItem elapsedSeconds The time elapsed in the current rendering of this item.
attribute” on page 156
s ki p F r a m e s “RenderQueueItem skipFrames attribute” The number of frames to skip when rendering this item.
on page 159
outputModules “RenderQueueItem outputModules The collection of Output Modules for this item.
attribute” on page 158
onStatusChanged “RenderQueueItem onStatusChanged A callback function that is called during the rendering
attribute” on page 157 process when the status of the item changes.
Methods
outputModule() “RenderQueueItem outputModule() method” on Gets an Output Module for the item.
page 158
re move () “RenderQueueItem remove() method” on page 158 Removes the item from the render queue.
155
JavaScript Reference RenderQueueItem object
156
Description
Applies a Render Settings template to the item. See also “RenderQueueItem saveAsTemplate() method” on
page 159 and “RenderQueueItem templates attribute” on page 160.
Parameters
Returns
Nothing.
Description
The composition that will be rendered by this render-queue item. To change the composition, you must delete
this render-queue item and create a new one.
Type
Description
Parameters
None.
Returns
RenderQueueItem object.
156
JavaScript Reference RenderQueueItem object
157
Description
Type
Description
A log type for this item, indicating which events should be logged while this item is being rendered.
Type
Description
Type
Integer; read-only.
Description
The name of a callback function that is called whenever the value of the Re n de rQ ueue I te m .s ta tus attribute
changes. See “RenderQueueItem status attribute” on page 159.
You cannot make changes to render queue items or to the application while rendering is in progress or paused;
you can, however, use this callback to pause or stop the rendering process. See “RenderQueue pauseRen-
dering() method” on page 153 and “RenderQueue stopRendering() method” on page 154.
See also “Application onError attribute” on page 26.
Type
Example
f u n c t io n m y S t a t u s C h a n g e d ( ) {
a l ert (a pp.pro ject .ren de rQu eue .item (1 ). st at us)
}
157
JavaScript Reference RenderQueueItem object
158
Description
Type
Description
Parameters
index The position index of the output module. An integer in the range [1..numO ut pu tM odules ].
Returns
OutputModule object.
Description
Parameters
None.
Returns
Nothing.
Description
When true, the item will be rendered when the render queue is started. When set to true, the R e n d e r -
Q ueu eIt em.st atu s is set to R QI t em S ta tu s. QU E UE D . When set to false, st at us is set to RQI tem-
S ta tu s. U N Q U E U E D .
158
JavaScript Reference RenderQueueItem object
159
Type
Boolean; read/write.
Description
Saves the item’s current render settings as a new template with the specified name.
Parameters
Returns
Nothing.
Description
The number of frames to skip when rendering this item. Use this to do rendering tests that are faster than a
full render.
A value of 0 skip no frames, and results in regular rendering of all frames. A value of 1 skips every other frame.
This is equivalent to "rendering on twos." Higher values skip a larger number of frames.
The total length of time remains unchanged. For example, if skip has a value of 1, a sequence output would
have half the number of frames and in movie output, each frame would be double the duration.
Type
Description
Type
Date object, or null if the item has not started rendering; read-only.
Description
159
JavaScript Reference RenderQueueItem object
160
Type
R Q I t e m S t a tu s. UN Q U E U E D Item is listed in the Render Queue panel but composition is not ready to render.
R Q I t e m S t a tu s. RE N D E R I N G Composition is rendering
Description
The names of all Render Settings templates available for the item. See also “RenderQueueItem saveAsTemplate()
method” on page 159.
Type
Description
The duration in seconds of the composition to be rendered. The duration is determined by subtracting the
start time from the end time. Setting this value is the same as setting a custom end time in the Render Settings
dialog box.
Type
Description
The time in the composition, in seconds, at which rendering will begin. Setting this value is the same as setting
a custom start time in the Render Settings dialog box.
Type
160
JavaScript Reference RQItemCollection object
161
RQItemCollection object
a pp.proj ect .render Qu eue .item s
Description
The RQItemCollection contains all of the render-queue items in a project, as shown in the Render Queue
panel of the project. The collection provides access to the RenderQueueItem objects, and allows you to create
them from compositions. The first RenderQueueItem object in the collection is at index position 1. See
“RenderQueueItem object” on page 155
• RQItemCollection is a subclass of Collection. All methods and attributes of Collection are available when
working with RQItemCollection. See “Collection object” on page 51.
Methods
a dd ( ) “RQItemCollection add() method” on page 161 Adds a composition to the Render Queue.
Description
Parameters
Returns
RenderQueueItem object.
161
JavaScript Reference Settings object
162
Settings object
Description
The Settings object provides an easy way to manage settings for scripts. The settings are saved in the After
Effects preferences file and are persistent between application sessions. Settings are identified by section and
key within the file, and each key name is associated with a value. In the preferences file, section names are
enclosed in brackets and quotation marks, and key names are listing in quotation marks below the section
name. All values are strings.
You can create new settings with this object, as well as accessing existing settings.
Methods
s av e S e tt i n g () “Settings saveSetting() method” on page 163 Saves a default value for a setting.
h aveS e tt in g () “Settings haveSetting() method” on page 162 Reports whether a specified setting is assigned.
Description
Parameters
Returns
String.
Example
If you have saved a setting named with the key name “Aligned Clone” in the “Eraser - Paint Settings” section,
you can retrieve the value with this script:
v a r n = ap p .se tt i n g s. g e t Se tt i n g (" E r as e r - P a i n t S e t t i n g s ", " A l i g n e d C l o n e " ) ;
a l e r t (" T h e s e tt i n g i s " + n );
Description
Returns true if the specified scripting preferences item exists and has a value.
162
JavaScript Reference Settings object
163
Parameters
Returns
Boolean.
Description
Parameters
Returns
Nothing.
163
JavaScript Reference Shape object
164
Shape object
a pp .p r o j e c t .i te m (i nd e x) .laye r( in de x) .pro pe rty ( in d ex ). pr op ert y (" m a sk S ha pe "). value
Description
The Shape object encapsulates information describing a shape in a shape layer, or the outline shape of a Mask.
It is the value of the “Mask Path” AE properties, and of the "Path" AE property of a shape layer. Use the
constructor, new S h a p e ( ) , to create a new, empty Shape object, then set the attributes individually to define
the shape.
A shape has a set of anchor points, or vertices, and a pair of direction handles, or tangent vectors, for each
anchor point. A tangent vector (in a non-RotoBezier mask) determines the direction of the line that is drawn
to or from an anchor point. There is one incoming tangent vector and one outgoing tangent vector associated
with each vertex in the shape.
A tangent value is a pair of x,y coordinates specified relative to the associated vertex. For example, a tangent
of [-1,-1] is located above and to the left of the vertex and has a 45 degree slope, regardless of the actual
location of the vertex. The longer a handle is, the greater its influence; for example, an incoming shape
segment stays closer to the vector for an in T an g e n t of [-2,-2] than it does for an i n T a n g e n t of
[-1,-1], even though both of these come toward the vertex from the same direction.
If a shape is not closed, the i n T a n g e n t for the first vertex and the ou tTa n gent for the final vertex are ignored.
If the shape is closed, these two vectors specify the direction handles of the final connecting segment out of
the final vertex and back into the first vertex.
RotoBezier masks calculate their tangents automatically. (See “MaskPropertyGroup rotoBezier attribute” on
page 103.) If a shape is used in a RotoBezier mask, the tangent values are ignored. This means that, for
RotoBezier masks, you can construct a shape by setting only the v e r ti c e s attribute and setting both in T an g e n ts
and o utT an g e n ts to null. When you access the new shape, its tangent values are filled with the automatically-
calculated tangent values.
A square is a closed shape with 4 vertices. The i n T a n g e n ts and o u t T a n g e n t s for connected straight-line
segments are 0, the default, and do not need to be explicitly set.
v a r m y S h a pe = n e w S h a p e () ;
my S ha pe .ve rti c es = [[ 0,0 ], [0 ,10 0], [1 00, 100 ], [ 10 0,0 ]] ;
m y S h a p e .c l o s e d = t r u e ;
A "U" is an open shape with the same 4 vertices used in the square:
v a r m y S h a pe = n e w S h a p e () ;
my S ha pe .ve rti c es = [[ 0,0 ], [0 ,10 0], [1 00, 100 ], [ 10 0,0 ]] ;
m y S h a pe .c l o s e d = f a l s e ;
An oval is a closed shape with 4 vertices and with i n T a n g e n t and o utT a n g en t values:
v a r m y S h a pe = n e w S h a p e () ;
m y S h a p e .v e r t i c e s = [ [ 3 0 0 , 5 0 ], [2 00,1 50],[30 0,25 0],[400 ,150 ]];
m y S h a pe .i n T a n g e n t s = [ [ 5 5 . 2 3 ,0 ] , [ 0 , - 5 5 .2 3] ,[ - 5 5.2 3 ,0 ], [0 , 5 5 . 2 3 ] ] ;
mySha pe .ou tTa n gent s = [[-55 .23 ,0],[0, 55.2 3],[55. 23,0 ], [0 ,-55 .23]];
m y S h a p e .c l o s e d = t r u e ;
164
JavaScript Reference Shape object
165
Attributes
closed “Shape closed attribute” on page 165 When true, the shape is a closed curve.
ve rtices “Shape vertices attribute” on page 166 The anchor points of the shape.
inTangents “Shape inTangents attribute” on page 165 The tangent vectors coming into the shape vertices.
outTangents “Shape outTangents attribute” on page 165 The tangent vectors coming out of the shape vertices.
Description
When true, the first and last vertices are connected to form a closed curve. When false, the closing segment is
not drawn.
Type
Boolean; read/write.
Description
The incoming tangent vectors, or direction handles, associated with the vertices of the shape. Specify each
vector as an array of two floating-point values, and collect the vectors into an array the same length as the
ve rtices array.
Each tangent value defaults to [0,0]. When the mask shape is not RotoBezier, this results in a straight line
segment.
If the shape is in a RotoBezier mask, all tangent values are ignored and the tangents are automatically calcu-
lated.
Type
Description
The outgoing tangent vectors, or direction handles, associated with the vertices of the shape. Specify each
vector as an array of two floating-point values, and collect the vectors into an array the same length as the
ve rtices array.
Each tangent value defaults to [0,0]. When the mask shape is not RotoBezier, this results in a straight line
segment.
If the shape is in a RotoBezier mask, all tangent values are ignored and the tangents are automatically calcu-
lated.
165
JavaScript Reference Shape object
166
Type
Description
The anchor points of the shape. Specify each point as an array of two floating-point values, and collect the
point pairs into an array for the complete set of points. For example:
my S ha pe .ve rti c es = [[ 0,0 ], [0 ,1] , [ 1,1 ], [1 ,0] ] ;
Type
166
JavaScript Reference ShapeLayer object
167
ShapeLayer object
a pp .p r o j e c t .i te m (i nd e x) .l a y e r( in de x)
Description
The ShapeLayer object represents a shape layer within a composition. Create it using the LayerCollection
object’s a dd S h ap e ( ) method; see “LayerCollection addShape() method” on page 94. It can be accessed in an
item’s layer collection either by index number or by a name string.
• ShapeLayer is a subclass of AVLayer, which is a subclass of Layer. All methods and attributes of AVLayer and
Layer are available when working with ShapeLayer. See “Layer object” on page 83 and “AVLayer object” on
page 39.
167
JavaScript Reference SolidSource object
168
SolidSource object
a pp .p r o j e c t .i te m (i nd e x) . m a in So ur c e
a pp .p r o j e c t .i te m (i nd e x) .p roxySour ce
Description
Attributes
color “SolidSource color attribute” on page 168 The color of the solid.
Description
The color of the solid, expressed as red, green, and blue values.
Type
Array of three floating-point values, [R, G, B], in the range [0.0..1.0]; read/write.
168
JavaScript Reference System object
169
System object
s y st e m
Description
The System object provides access to attributes found on the user’s system, such as the user name and the
name and version of the operating system. It is available through the sy s te m global variable.
Example
a l e r t ( " Y ou r O S i s " + s y s t e m . o s n a m e + " r u n n i n g v er s i o n " + s y s t e m . os v e r s i o n ) ;
confirm("You are: " + system.userName + " running on " + system.machineName + ".");
Attributes
userName “System userName attribute” on page 170 The current user name.
machineName “System machineName attribute” on page 169 The name of the host computer.
osName “System osName attribute” on page 170 The name of the operating system.
osVe rsio n “System osVersion attribute” on page 170 The version of the operating system.
Methods
c a l l S y s t e m () “System callSystem() method” on page 169 Execute’s a command on the system’s command line.
Description
Executes a system command, as if you had typed it on the operating system’s command line. Returns whatever
the system outputs in response to the command, if anything.
In Windows, you can invoke commands using the / c switch for the c m d . e x e command, passing the command
to run in escaped quotes (\ " . . . \ " ). For example, the following retrieves the current time and displays it to the
user:
v a r t im e S t r = s y s t e m . c a l lS y s t e m ( " c m d . e x e / c \ " t i m e / t \ " " ) ;
a l e r t ( " C u r r e n t t im e i s " + t i m e S t r ) ;
Parameters
Returns
169
JavaScript Reference System object
170
Description
Type
String; read-only.
Description
Type
String; read-only.
Description
Type
String; read-only.
Description
Type
String; read-only.
170
JavaScript Reference TextDocument object
171
TextDocument object
ne w Te xt Do cument( do cT ex t )
a pp .p r o j e c t .i te m (i nd e x) .laye r( in de x) .pro pe rty ( " S o u r c e T e x t " ) . v a l u e
Description
The TextDocument object stores a value for a TextLayer's Source Text property. Create it with the
constructor, passing the string to be encapsulated.
Examples
This sets a value of some source text and displays an alert showing the new value:
v a r m y T e x t D o cu m e n t = n e w T e x tD o c u m e n t( " H a pp y C a ke ") ;
m y T e xt L a y e r . p r o p e r t y ( " So u r c e T e x t " ) . s e t V a l u e ( m y T e x t D oc u m e n t ) ;
a l e r t ( m y T e xt L a ye r . p r o p e r t y ( " S o u r c e T ex t " ) . v a l u e ) ;
This sets keyframe values for text that show different words over time:
var textProp = myTextLayer.property("Source Text");
t ex t P r o p . s e t V a l u e A t T i m e ( 0 , n e w T e x tD o c u m e n t( " H ap py " ) ) ;
t extProp.set Va lueA tTime(.3 3, ne w Te xtD ocumen t("cak e"));
t ex t P r o p . s e t V a l u e A t T i m e ( . 6 6 , n e w T e x t D o c u m e n t( " is " ) ) ;
t ex t P r o p . s e t V a l u e A t T i m e ( 1 , n e w T e x t D o c u m e n t( " y u m m y! " )) ;
Attributes
t ex t “TextDocument text attribute” on page 171 The text layer’s Source Text value.
Description
The text value for the text layer’s Source Text property.
Type
String; read/write.
171
JavaScript Reference TextLayer object
172
TextLayer object
a pp .p r o j e c t .i te m (i nd e x) .l a y e r( in de x)
Description
The TextLayer object represents a text layer within a composition. Create it using the LayerCollection object’s
a dd T ex t method; see “LayerCollection addText() method” on page 95. It can be accessed in an item’s layer
collection either by index number or by a name string.
• TextLayer is a subclass of AVLayer, which is a subclass of Layer. All methods and attributes of AVLayer and
Layer are available when working with TextLayer. See “Layer object” on page 83 and “AVLayer object” on
page 39.
AE Properties
TextLayer defines no additional attributes, but has the following AE properties and property groups, in
addition to those inherited from AVLayer:
T e xt
Source Text
P at h O pt i o n s
P at h
Reverse Path
Perpendicular To Path
For c e Alignmen t
F i r s t M ar g i n
Last Margin
M ore O p ti on s
A n ch o r P o i n t G r o u p i n g
G r o up in g A l ig n m e n t
F i l l & St r o k e
Int er-C har acte r Ble n ding
An ima to rs
The T i m e R e m a p and M oti on T r ac k ers properties, inherited from AVLayer, are not applicable to text layers,
and their related AVLayer attributes are not used:
c a n Se tT i m e R em a p E n ab l e d
t im eRem ap E n ab l e d
t rac k M a tt eT y p e
i s T r a c k M a tt e
h as T rac k Ma tt e
172
Examples
This section describes sample scripts that are included on your DVD, giving an overview of what they do and
a description of how they work.
This set of examples is by no means exhaustive, but it does demonstrate some of scripting’s more complex
features in action. It also shows some typical programming constructions from JavaScript that apply to
scripting.
For more examples from Adobe and from other After Effects users, visit Adobe Studio Exchange at
http://share.studio.adobe.com, and choose Script in the Adobe After Effects section.
173
Examples Render named items
174
Smart import
This script, s m art I m p o rt .j sx , allows the user to import the full, nested contents of a folder just by selecting it.
It attempts to detect whether each item is a still, moving footage, or an image sequence. The user still has to
make other choices in dialog boxes, such as which layer of a multi-layer image (such as a PSD file) to import.
This script does the following:
• Prompts the user for a folder whose contents are to be imported, and checks that the user chooses a folder
rather than cancelling.
• Defines a function, pr oc es sF ol d er () , to import each of the files in the chosen folder, which uses several
helper functions.
• Defines a helper function, tes t ForS eq uence () , to test whether a given file is part of a sequence. This uses
regular expressions, which are a special type of JavaScript designed to reduce the number of steps required
to evaluate a string.
The first one tests for the presence of sequential numbers anywhere in the file name, followed by another
making certain that the sequential files aren’t of a type that can’t be imported as a sequence (moving image
files). The function then checks adjacent files to see if a sequence exists, stopping after we’ve evaluated ten
174
Examples Render and e-mail
175
If no match is found for a number string, assumes there is no image sequence and checks for an array
consisting of the matched string and its location within the file name.
If all files are part of a numbered sequence, assumes a sequence and returns the first file of that sequence.
• Defines a helper function to pop up error dialog boxes if there is a problem with any file we are attempting
to import.
• Defines a helper function to actually import any image sequence discovered using t es t F o r S e q u en c e ( ) .
There is an option for forcing alphabetical order in sequences, which is commented out in the script as
written. If you want to force alphabetical order, uncomment the line i m p ort Op ti on s.f or ce Alp ha be ti cal =
t ru e .
175
Examples Convert selected properties to markers
176
This script adds a layer-time marker on the layer at the same time as each keyframe for each selected property.
Each marker is associated with an event-type Flash Video cue point, and the cue point is given a parameter
whose name is the name of the property and whose value is the property’s value at that time. If the selected
property has an expression, a marker is created for each frame, with the values sampled at each frame.
Note: This script does not convert properties that have complex value types, such as the Path property for a paint
stroke, the Curves property of a Curve effect, or a gradient property.
When you render the composition as Flash video, all markers that contain cue-point data are converted to
Flash Video cue points.
176
After Effects Object Summary
This code dump summarizes all public JavaScript objects (instantiable classes) and enumerated types defined
for After Effects CS3.
= == == === == == === == === == == === == === == == === == === == == === == == === == === == == === ==
A l ph aM ode en um
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A l ph aM ode .I G N O RE
A l ph aM ode .PREMU L TIPLIED
A l ph aM ode .S T RAI GH T
= == == === == == === == === == == === == === == == === == === == == === == == === == === == == === ==
A pp l i c at io n ob je c t
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
a c ti va te () no re tu rn
b e g i n Su pp r e ss Di a l o g s () n o r e tu r n
be ginUndoGro up(str ing undoNam e) n o ret urn
b u i ld N a m e : s t r i n g : r e ad On l y
b u i ld N u m b e r : i n t eg e r : r e a d O n l y
c a n c e l T a s k ( i n t e g e r ta skID ) no ret urn
e n d Su pp r e ss Di a lo g s( b o o le an s how Ale rt) no r etu rn
e n d U n d o G r o u p( ) n o r e t u r n
e n d W a t c h F o l d e r ( ) n o r e t ur n
e x it A f t e r L a u n c h A n d E v a l : b o o l e a n : r e a d / w r i t e
e x it Code : int ege r : re ad/write
findMenuCommandId() returns integer
i s P r o f e s s i o n a l V e r si o n : b o o l e a n : r e a d O n ly
i s R e n de rE n g i n e : b o o l e a n : r e a d O n l y
i s UI S u pp r e s s e d : b o o l e an : r e ad O n l y
i s W a t c h F o l d e r : b o o l e an : r ea d O n l y
l a n g u a g e : L an g u a g e : r e a d O n l y
m em o r yI n U s e : n u m b e r : r e a d O n l y
n ewPro ject () no r etu rn
o pe n ([ F i l e f il e ]) r e t u r n s P r o j e c t
o pe n T e m p l a t e ( F i l e f i l e T oO p e n W it h T e m p l a t e Se m a n t i c s ) n o r e t u r n
pa rse S wa tchFile(File swa tch File ) re tu rns Swat chO b ject
p a u s e W a t c h F o l d e r ( b o o l e a n d o P a u se ) n o r e t ur n
p ro ject : P roje c t : r ead O n ly
pur g e(Pu rgeTa rge t t arge t) no re tur n
q uit () no re tu rn
sa veProj ectO nCra sh : boo le an : rea d/write
s c he du leTas k (s tr i n gToEx ecu te, floa t d ela y, boole an re pe at ) re tu rns tas k ID
s et Me m oryU sa geLi mi ts ( floa t i m a g eCa c heP er ce n t, floa t m ax i m umM emoryP er ce n t) no r etu rn
s et S ave Pr ef eren c e sO n Q ui t( b ool e an d oS ave ) n o ret urn
s et ti n g s : S et ti n g s : r ead O n l y
177
After Effects Object Summary
178
178
After Effects Object Summary
179
179
After Effects Object Summary
180
180
After Effects Object Summary
181
laye r(Layer oth erLa y er, int ege r rela tive Inde x) re tu rns Layer
l a y e r s : L a y e r C o l l e c t i o n : r e a d O n ly
m o t i o n B lu r : b o o l e a n : r e a d / w r i t e
n a m e : s t r i n g : r e a d / w r it e
nu mLayer s : int ege r : re adOn ly
p a r en t F o l de r : F o l d e r I te m : r e a d/ w r i t e
p i xe lAs pe c t : f l oa t : r ead /w ri te
pr e s e r v e N e s t e d F r a m e Ra t e : b o o l e a n : r e a d / w r it e
p r e s e r v e N e s t e d R e s o l u t i o n : b o o l e a n : r e a d/ w r i t e
p r o x y S o u r ce : F o o t a g e S o u r c e : r e a d O n l y
re move () no re tu rn
re nde rer : st ring : read/write
re nde rer s : A rra y of st ring: re adOn ly
re so lu tionFa ctor : Arr ay of inte ger : rea d/write
s elect ed : boole an : r ead /w rite
selectedLayers : Array of Layer : readOnly
s e l e c t e d P r o p e r t i e s : A r r a y o f P r o p e rt yB as e : r e a dO n l y
s e t Pr o x y( F i l e p r o x y F i l e ) n o r e t u r n
s e t P r ox yT oN o n e ( ) n o r e t u r n
s et Pr o x yW it hP l ac e ho l d e r ( s t r i n g n a m e , i n t eg e r w i d t h , i n t eg e r hei g ht , f l oa t f rame Rat e, floa t d ur ati on )
no ret urn
s et Pr o x yW it hS eq ue n c e(F i l e p ro xy F i l e, b o o l ea n fo rc eAl p ha b et ic a l ) n o ret urn
set Pr oxyW it hSolid(A rra yO fFloat color, st ring nam e, int eger width , inte ger h eight ,
float pixelAspecRatio) no return
shut te rAngle : inte ger : rea d/write
shut te rPha se : integ er : r ead/write
t im e : f l o at : re ad / w ri te
t y p e N a m e : s t r i n g : r ea d O n l y
usePro xy : boolea n : re ad/wr it e
u s e d I n : A r r a y o f CompIte m : re adOnly
w i dt h : int ege r : re ad /wr it e
workAre aD ura tion : floa t : rea d/write
w o rk Are aS ta rt : f l o at : re ad / wr it e
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == ==
F i e l d S e p a r a ti o n T y p e e n u m
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
FieldSeparationType.LOWER_FIELD_FIRST
F i e l d S e p a r a ti o n T y p e . O F F
F i e l d S e p a r a ti o n T y p e . U P PE R _ F I E L D _ F I R S T
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == ==
FileSource object
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
a lp h aMo de : A l p h a M o d e : r e ad / w r i te
conform F rame Rat e : floa t : read/write
d i s p l a y F r a m e R at e : f l o a t : r e a d O n l y
f i e l d S e pa ra t i o n T y p e : F i e l d S e p a r a ti o n T y p e : r e a dO n l y
f i le : File : r ead O n ly
guessAlphaMode() no return
g u e ss P u l l d o w n (P u l l d o w n M e t h o d p ul l d ow nMet ho d) no re tu rn
h as Al ph a : b ool ea n : re ad On l y
h ig h Q u a l i t y F i e l d S e p a r a t i o n : b o o l e a n : r e a d / w r it e
181
After Effects Object Summary
182
182
After Effects Object Summary
183
183
After Effects Object Summary
184
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
CameraLayer object
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
( i n t e g e r p r o p e r t y I n d e x ) r e t ur n s P r o p e r t y B a s e
( st r i n g p r o p e r ty N am e) r e t ur n s P r o p e r t y B a s e
a ct i v e : b o o l e a n : r e a d O n l y
a ct i v e A tT i m e ( f l o a t a t T i m e ) r e t u r n s b o o l e an
a dd P r o p e r t y ( s t r i n g p r o p e r t y N a m e ) r e t u r n s P r o pe rt y B as e
a dj us tm en tL a y er : b o ol ean : rea dO n l y
a pp l y Pr e s e t( s tr in g p re se tN a m e) n o re tur n
auto Orie nt : A utoOr ie ntType : read/write
c an A d dP r o p e r ty ( st r i n g p r o p ert y N am e) r et urn s b o o l ea n
c an Se tE n a b l ed : b ool e an : r ead O n l y
c o m m e n t : s t r i n g : r ea d / w r i t e
containingComp : CompItem : readOnly
copyToComp(CompItem intoComp) no return
d u p l i ca te () r e t u r n s C a m e r aL a ye r
e l i d e d : b o o le an : r e a dO n l y
e n a b l e d : b o o le an : r e a d/ w r i t e
h as Vi de o : b oo l ean : rea dO n l y
i n P o i n t : fl o a t : r e a d/ w r i t e
i n d e x : i n t e g e r : r e a dO n l y
i s E f f ec t : b o o l e an : r ea d O n l y
i s M a s k : b o o l e an : r ea d O n l y
i s M o d i fi e d : b o o l e a n : r e a dO n l y
is Name Se t : bo olean : rea d Only
l o c k e d : b o o le an : r e a d/ w r i t e
m a t c h N a m e : s t r i n g : r ea d O n l y
mo veAfte r(Layer oth erLa y er) no re tu rn
mo veBe fo re(Laye r ot herL ayer) no r etu rn
moveTo(integer index) no return
moveToBeginning() no return
moveToEnd() no return
n a m e : s t r i n g : r e a d / w r it e
n u ll L a y e r : b o o l e a n : r e a d O n l y
nu mPr opert ie s : int ege r : re adO n ly
o u t P o i n t : f l o at : r e a d/ w r i t e
p ar en t : L ay er : re ad / wr it e
p ar en tP ro pe rty : Pro pe rty G ro up : re ad On l y
p r o p e r t y ( i n t e g e r p r o p e r t y I n d e x ) r e tu r n s Pr o p e r t y Bas e
p r o p e r ty ( st r i n g p r o p e r t y N am e ) r e tu r n s Pr o p e r t y Bas e
proper tyDe pt h : int ege r : re adO n ly
p r o p e r t y G r o u p ( [ i n t e g e r c o u n t Up ] ) r e tu r n s Pr o p e r t y Gr o u p
p r o p e r t y T y p e : P r o p e r t y T y p e : r ea d O n l y
re move () no re tu rn
s elect ed : boole an : r ead /w rite
s e l e c t e d P r o p e r t i e s : A r r a y o f P r o p e rt yB as e : r e a dO n l y
s et Pa ren t W i th Jum p ( L ay e r newParen t) no re tur n
s h y : b o o l e a n : r e a d/ w r i t e
s olo : bo olea n : rea d /writ e
s ta rtT ime : f l oat : re ad /wr it e
184
After Effects Object Summary
185
185
After Effects Object Summary
186
186
After Effects Object Summary
187
a pp l y T e m p l at e ( st r i n g t em p l at eN a m e) n o ret ur n
f i le : File : r ead /w rite
name : string : readOnly
p o s tR e n d e r A c t i o n : P o s tR e n d e r A c t i o n : r e a d / w r i t e
re move () no re tu rn
s ave As T em p l at e( st ri n g t em p l at eN am e) n o ret urn
t em p l at es : Arr ay o f st ri n g : read O n l y
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = ==
PlaceholderSource object
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
a lp h aMo de : A l p h a M o d e : r e ad / w r i te
conform F rame Rat e : floa t : read/write
d i s p l a y F r a m e R at e : f l o a t : r e a d O n l y
f i e l d S e pa ra t i o n T y p e : F i e l d S e p a r a ti o n T y p e : r e a d/ w r i t e
guessAlphaMode() no return
g u e ss P u l l d o w n (P u l l d o w n M e t h o d p ul l d ow nMet ho d) no re tu rn
h as Al ph a : b ool ea n : re ad On l y
h ig h Q u a l i t y F i e l d S e p a r a t i o n : b o o l e a n : r e a d / w r it e
inve rtA l ph a : boo l ean : rea d/writ e
i s St i l l : b o o l e a n : r e a d On l y
loo p : int ege r : re ad/wr it e
na tive Fr ame Rat e : f l oa t : r ead O n ly
p rem ul C ol or : Arr ay of fl o at : rea d/ w ri t e
r e m o v e P u l ld o w n : P u l l d o w n P h a s e : r e a d/ w r i t e
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = =
PostRenderAction enum
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
P o s tR e n d e r A c t i o n .I M PO R T
P o s t R e n d e r A c t i o n . I M PO R T _ A N D _ R E P L A C E _ U S A G E
P o s tR e n d e r A c t i o n .N O N E
PostRenderAction.SET_PROXY
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = ==
P r o j e c t o b jec t
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
a ct i v e I t e m : I t e m : r e a d O n l y
a u to F ix E x p r e s s io n s( o l d T e x t ,
n e w T e xt ) n o r e t u r n
b i t s P e r C h an n e l : i n t e g e r : r e a d/ w r i t e
c l o s e ( C l o s e O p t i o n s cl o se Op t i o n s) r e t u r n s b o o le an
c o n s o l i d a t e F o o t a g e () r e t u r n s i n t e g e r
displaySta rt Frame : inte ger : rea d/writ e
f i le : File : r ead O n ly
i m p o r t F i l e ( I m po rt O p t i o n s i m p o r t O p t i o n s ) r e t ur n s I t e m
i m p o r t F i l e W i t h D i a l o g ( ) r e t ur n s A r r a y O f I t e m
import Pla c eho l de r(st ring itemN ame, integ er ite m Widt h, int ege r ite m He igh t, floa t fra m eRa te ,
f l o a t d u r a t i o n ) r et u r n s F o o t a g e I t e m
i te m ( in t e g e r i te m I n de x ) r e tu r n s I te m
items : ItemCollection : readOnly
l i n e a r B l e n d i n g : b o o l e a n : r e a d / w r it e
nu mIte ms : in tege r : r eadOnly
r e du c e P r o j e c t ( A r r a y O f I t em i t e m s T o P r e s e r v e ) r et ur n s i n t e g er
187
After Effects Object Summary
188
188
After Effects Object Summary
189
189
After Effects Object Summary
190
190
After Effects Object Summary
191
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == =
P urg e T ar g et e n um
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
Purge T ar get. ALL_CA CHE S
Purge T ar get. IMA GE _ CACHES
Purge T ar get. SNAPSH O T _CACH E S
P u r g e T ar g e t. UN D O_ C A C H E S
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
Re nde rQ ueu e obje ct
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
ite m (int ege r item Inde x) re tu rns RenderQ ue ueIt em
i t e m s : R Q I t e m C o l l e c t io n : r e a d O n l y
nu mIte ms : in tege r : r eadOnly
p au se R e n d e r i n g ( b o o l e an d o P au se ) n o r e tu r n
re nde r() no ret urn
r e n d e ri n g : b o o l e a n : r e a d O n l y
s h o w W i n d o w ( b o ol e a n d o S h o w ) n o r et u r n
s t o pR e n d e r i n g ( ) n o r e t u r n
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = =
Re nde rQ ueu eIte m obje ct
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
a pp l y T e m p l at e ( st r i n g t em p l at eN a m e) n o ret ur n
c o m p : C om p I t e m : r e a d O n l y
du pl i c a te () r e t ur n s R e n d e r Q ue u e I t em
e l a ps e d S e c o n d s : f l o at : r e ad On l y
l o g T y p e : L o g T y p e : r ea d / w r i t e
n u m O u tp u t M o d u l e s : i n t e g e r : r e a d O n l y
ou tp ut Mod ule( i n te ger o utp ut Mo du le Ind ex ) r etu rns Ou tp ut Mod ule
o u t p u t M o d u l e s : O MC o l l e c t i o n : r e a dO n l y
re move () no re tu rn
re nde r : boo l ean : rea d/writ e
s ave As T em p l at e( st ri n g t em p l at eN am e) n o ret urn
s k i pF r a m e s : i n t e g e r : r e a d/ w r i t e
s ta rtT ime : f l oat : re ad Only
s ta tu s : R QIt emSt at us : rea dO n ly
t em p l at es : Arr ay o f st ri n g : read O n l y
t im eS pa n Du rat i o n : f l o at : re ad / w ri te
t im eS pa n S ta rt : fl oa t : rea d/ w ri t e
o n S t a t u s C h a n g e d ( ) n o r et u r n
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = ==
R Q I t e m C o l l e ct i o n o b j e c t
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
a d d ( C o m p I t e m c o m p T o A d d ) r et u r n s R e n d e r Q u e u e I t e m
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = ==
R Q I t e m S t a tu s e n u m
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
R Q I t e m S t a tu s. DO N E
R Q I t e m S t a tu s. E R R _ S T O P P E D
R Q I t e m S t a tu s. N E E D S _ O U T P U T
R Q I t e m S t a tu s. QU E U E D
R Q I t e m S t a tu s. RE N D E R I N G
191
After Effects Object Summary
192
R Q I t e m S t a tu s. UN Q U E U E D
R Q I t e m S ta tu s. U S E R _ S T O PP E D
R Q I t e m S t a tu s. W I L L _ C O N T I N U E
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
S e t ti n g s o b j e c t
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
ge tS et ti ng( st ri n g s ecti o nName , s tr i n g s e c t io n K e y ) r e tu r n s st r i n g
h av e S e t t in g (s t r in g s e c t i o n N a m e , s t r in g s e ct i o n K e y ) r e t u r n s b o o le an
s a v e S e t t i n g ( s t r i n g s e c t i o n N a m e , s t r i n g sectionKe y, string ne wV alue ) no r eturn
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
S h a pe o b j e ct
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
n e w S h a pe () r e tur n s S h a p e
c l o s e d : b o o le an : r e a d/ w r i t e
i n T a n g e n t s : A r r a y o f floa t[ 2] : re ad /wr i te
ou tTa n gents : Arr ay of floa t[ 2] : r ead /w ri te
ve rtices : A rra y o f floa t[2] : rea d /writ e
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
S ol i d So urc e o bj ec t
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
a lp h aMo de : A l p h a M o d e : r e ad / w r i te
c ol or : Arr ay of f lo at : rea d / wr it e
conformFrameRate : float : readOnly
d i s p l a y F r a m e R at e : f l o a t : r e a d O n l y
f i e l d S e pa ra t i o n T y p e : F i e l d S e p a r a ti o n T y p e : r e a dO n l y
guessAlphaMode() no return
g u e ss P u l l d o w n (P u l l d o w n M e t h o d p ul l d ow nMet ho d) no re tu rn
h as Al ph a : b ool ea n : re ad On l y
h igh Qu alityFieldSepara tion : boolea n : re adOn ly
inve rtA l ph a : boo l ean : rea d/writ e
i s St i l l : b o o l e a n : r e a d On l y
loo p : int ege r : re adOn ly
na tive Fr ame Rat e : f l oa t : r ead O n ly
p rem ul C ol or : Arr ay of fl o at : rea d/ w ri t e
r e m o v e Pu l ld o w n : P u l l d o w n P h a s e : r e a dO n l y
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
S y st e m o b j e c t
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
c a l l S y s tem (s tr in g cm dL i n e T o E x e c t u te ) r et u r n s o u t p u tO f C om m a n d A sS t r i n g
machineName : string : readOnly
o s N a m e : s t r in g : r e a d O n l y
osVe rsio n : string : rea dO n ly
userName : string : readOnly
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
T e xt D o c u m e n t o b j e c t
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
n e w T e xt D o c u m e n t ( s t r i n g t e x t ) r e t u r n s T e x t D o c u m e n t
t ext : st ring : re ad/write
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
Timeco de BaseT ype e n um
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
192
After Effects Object Summary
193
T i m e c o d e B a s e T y p e . AU T O
TimecodeBaseType.FPS100
TimecodeBaseType.FPS24
TimecodeBaseType.FPS25
TimecodeBaseType.FPS30
TimecodeBaseType.FPS48
TimecodeBaseType.FPS50
TimecodeBaseType.FPS60
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = ==
T i m e c o d e D i s p l a yT yp e e n u m
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
T i m e c o de D i s pl a yT yp e . F E E T _ A N D _ F R A M E S
T i m e c o d e D i s p l a yT yp e . F R A M E S
T i m e c o d e D i s p l a yT yp e . T I M E C OD E
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
T i m e c o d e F il m T yp e e n u m
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
T i m e c o d e F il m T y p e . M M 1 6
T i m e c o d e F il m T y p e . M M 3 5
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
TrackM atte Type enum
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
TrackM atte Type .ALPHA
TrackM atte Type .ALPHA _INVER TED
TrackM atte Type .LUM A
TrackM atte Type .LUM A_INV E RTED
TrackMatteType.NO_TRACK_MATTE
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
A u t o O r i e n tT y p e e n u m
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
A u t o O ri e n tT y p e . A L O N G _ P A T H
A u t o O r i e n tT y p e . C A ME R A _ O R _ PO I N T _ O F _ I N T E R E S T
A u t o O r i e n tT y p e . N O _ A U T O _ O R I E N T
= == == == = == == == = == == == == = == == == == = == == == == = == == == == = == == == == = == == == = == =
Fra m eB lendin gType enum
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
F r a m e B l e n d in g T y pe . F R A M E _ M I X
F r a m e B l e n d in g T y pe . N O _ F R A M E _ B L E N D
F r a m e B l e n d in g T y pe . P I X E L _ M O T I O N
- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -
193