After_Effects_CS6_Scripting_Guide(AE脚本参考书)

更新时间:2024-05-05 00:23:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

ADOBE? AFTER EFFECTS? CS6

SCRIPTING GUIDE

DRAFT

? Copyright 1992-2012 Adobe Systems Incorporated. All rights reserved. Adobe? After Effects? CS6 Scripting Guide

NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy or electronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of Adobe Systems Incorporated. The software described in this document is furnished under license and may only be used or copied in accordance with the terms of such license.

This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or

inaccuracies, makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes, and noninfringement of third party rights.

Any references to company names in sample templates are for demonstration purposes only and are not intended to refer to any actual organization.

Adobe, the Adobe logo, After Effects, and Photoshop are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.

Apple, Mac, and Macintosh are trademarks of Apple Computer, Inc., registered in the United States and other countries. Microsoft, and

Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries. JavaScript and all Java-related marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. UNIX is a registered trademark of The Open Group. All other trademarks are the property of their respective owners.All other trademarks are the property of their respective owners.

If this guide is distributed with software that includes an end user agreement, this guide, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated. Please note that the content in this guide is protected under copyright law even if it is not distributed with software that includes an end user license agreement.

The content of this guide is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies that may appear in the informational content contained in this guide.Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA.

Overview

Introduction to scripting in After Effects

A script is a series of commands that tells an application to perform a series of operations. You can use scripts in most Adobe applications to automate repetitive tasks, perform complex calculations, and even use some functionality not directly exposed through the graphical user interface. For example, you can direct After Effects to reorder the layers in a composition, find and replace source text in text layers, or send an e-mail message when rendering is complete.

See “Examples” on page191 for examples of what scripts can do.

Although both the After Effects expressions language and the After Effects ExtendScript scripting language are based on JavaScript, the expressions features and scripting features of After Effects are separate and distinct. Expressions cannot access information from scripts (such as variables and functions). Whereas a script tells an application to do something, an expression says that a property is something. However, because the After Effects expression language and ExtendScript are both based on JavaScript, familiarity with either one is very helpful in understanding the other.

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 ExtendScript objects that have been defined for After Effects projects.

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.

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).

Nearly all of what scripting can accomplish replicates what can be done by means of the After Effects graphical user interface. A thorough knowledge of the application itself and its graphical user interface is essential to understanding how to use scripting in After Effects.

The ExtendScript language

After Effects scripts use the Adobe ExtendScript language, which is an extended form of JavaScript used by several Adobe applications, including Photoshop, Illustrator, and InDesign. ExtendScript implements the JavaScript language according to the ECMA-262 specification. The After Effects scripting engine supports the 3rd Edition of the ECMA-262 Standard, including its notational and lexical conventions, types, objects, expres-sions, and statements. ExtendScript also implements the E4X ECMA-357 specification, which defines access to data in XML format.

ExtendScript defines a global debugging object, the dollar ($) object, and a reporting utility for ExtendScript elements, the ExtendScript Reflection interface.

3

OverviewThe ExtendScript Toolkit (ESTK)

4

File and Folder Objects:Because path name syntax is very different in different operating systems, Adobe

ExtendScript defines File and Folder objects to provide platform-independent access to the underlying file system.

ScriptUI User Interface Module:The ExtendScript ScriptUI module provides the ability to create and interact

with user interface elements. ScriptUI provides an object model for windows and UI control elements that you can use to create a user interface for your scripts.

Tools and Utilities: In addition, ExtendScript provides tools and features such as a localization utility for

providing user-interface string values in different languages and global functions for displaying short messages in dialog boxes (alert, confirm, and prompt).

External Communication:ExtendScript provides a Socket object that allows you to communicate with remote

systems from your After Effects scripts.

Interapplication Communication:ExtendScript provides a common scripting environment for all Adobe

applications, and allows interapplication communication through scripts.

The ExtendScript Toolkit (ESTK)

After Effects includes a script editor and debugger, the ExtendScript Toolkit (ESTK), which provides a conve-nient interface for creating and testing your own scripts.To start the ESTK, choose File > Scripts > Open Script Editor.

If you choose to use another text editor to create, edit, and save scripts, be sure to choose an application that does not automatically add header information when saving files and that saves with Unicode (UTF-8) encoding. In many text editors, you can set preferences for saving with UTF-8 encoding. Some applications (such as Microsoft Word) by default add header information to files that can cause “line 0” errors in scripts, causing them to fail.

For detailed information on the ExtendScript Toolkit, see the JavaScript Tools Guide.

The .jsx and .jsxbin file-name extensions

ExtendScript script files are distinguished by the .jsx file-name extension, a variation on the standard .js extension used with JavaScript files. After Effects scripts must include the .jsx file extension in order to be properly recognized by the application. Any UTF-8-encoded text file with the .jsx extension is recognized as an ExtendScript file.

You can use the ExtendScript Toolkit to export a binary version of an ExtendScript file, which has the

extension .jsxbin. Such a binary file may not be usable with all of the scripting integration features in After Effects.

Activating full scripting features

The default is for scripts to not be allowed to write files or send or receive communication over a network. To allow scripts to write files and communicate over a network, choose Edit > Preferences > General (Windows) or After Effects > Preferences > General (Mac OS), and select the Allow Scripts To Write Files And Access Network option.

4

OverviewLoading and running scripts

5

Any After Effects script that contains an error preventing it from being completed generates an error message from the application. This error message includes information about the nature of the error and the line of the script on which it occurred. The ExtendScript Toolkit (ESTK) debugger can open automatically when the application encounters a script error. This feature is disabled by default so that casual users do not encounter it. To activate this feature, choose Preferences > General, and select Enable JavaScript Debugger.

Loading and running scripts

Running scripts directly from the File > Scripts menu

When After Effects starts, it searches the Scripts folder for scripts to load. Loaded scripts are available from the File > Scripts menu.

To run a loaded script, choose File > Scripts > [script name].

If you edit a script while After Effects is running, you must save your changes for the changes to be applied. If you place a script in the Scripts folder while After Effects is running, you must restart After Effects for the script to appear in the Scripts menu, though you can immediately run the new script using the Run Script File command.

Running scripts using File > Scripts > Run Script File

To run a script that has not been loaded, choose File > Scripts > Run Script File, locate and select a script, and click Open.

Running scripts from the command line, a batch file, or an AppleScript script

If you are familiar with how to run a script from the command line in Windows or via AppleScript, you can send a script directly to the open After Effects application, so that the application automatically runs the script.To run a script from the command line, call afterfx.exe from the command line. Use the -r switch and the full path of the script to run as arguments. This command does not open a new instance of the After Effects appli-cation; it runs the script in the existing instance.Example (for Windows):

afterfx -r c:\\script_path\\example_script.jsx

You can use this command-line technique—together with the software that comes with a customizable keyboard—to bind the invocation of a script to a keyboard shortcut.

Following are examples of Windows command-line entries that will send an After Effects script to the appli-cation without using the After Effects user interface to execute the script.

In the first example, you copy and paste your After Effects script directly on the command line and then run it. The script text appears in quotation marks following the afterfx.exe -s command:

afterfx.exe -s \

Alternatively, you can specify the location of the JSX file to be executed. For example:

afterfx.exe -r c:\\myDocuments\\Scripts\\yourAEScriptHere.jsxafterfx.exe -r \

5

OverviewLoading and running scripts

6

How to include After Effects scripting in an AppleScript (Mac OS)

Following are three examples of AppleScript scripts that will send an existing JSX file containing an After Effects script to the application without using the After Effects user interface to execute the script.

In the first example, you copy your After Effects script directly into the Script Editor and then run it. The script text appears within quotation marks following the DoScript command, so internal quotes in the script must be escaped using the backslash escape character, as follows:

tell application \

DoScript \end tell

Alternatively, you could display a dialog box asking for the location of the JSX file to be executed, as follows:

set theFile to choose file

tell application \DoScript theFileend tell

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:

(*

This script sends the current selection to After Effects as a script.*)

tell application \

set the_script to text of front documentend tell

tell application \activate

DoScript the_scriptend tell

Running scripts automatically during application startup or shutdown

Within the Scripts folder are two folders called Startup and Shutdown. After Effects runs scripts in these folders automatically, in alphabetical order, on starting and quitting, respectively.

In the Startup folder you can place scripts that you wish to execute at startup of the application. They are executed after the application is initialized and all plug-ins are loaded.

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. Be sure to give variables in scripts unique names, so that a script does not inadvertently reassign global variables intended to persist throughout a session.Attributes can also be added to existing objects such as the Application object (see “Application object” on page17) to extend the application for other scripts.

6

OverviewLoading and running scripts

7

The Shutdown folder scripts are executed as the application quits. This occurs after the project is closed but before any other application shutdown occurs.

Running scripts from the Window menu

Scripts in the ScriptUI Panels folder are available from the bottom of the Window menu. If a script has been written to provide a user interface in a dockable panel, the script should be put in the ScriptUI folder. ScriptUI panels work much the same as the default panels in the After Effects user interface.

Instead of creating a Window object and adding controls to it, a ScriptUI Panels script uses the this object that represents the panel. For example, the following code adds a button to a panel:

var myPanel = this;

myPanel.add(\

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:

function createUI(thisObj) {var myPanel = thisObj;

myPanel.add(\return myPanel;}

var myToolsPanel = createUI(this);

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:

function createUI(thisObj) {

var myPanel = (thisObj instanceof Panel) ? thisObj : new Window(\[100, 100, 300, 300]);

myPanel.add(\return myPanel;}

var myToolsPanel = createUI(this);

Stopping a running script

A script can be stopped by pressing Esc or Cmd+period (in Mac OS) when the After Effects or the script’s user interface has focus. However, a script that is busy processing a lot of data might not be very responsive.

7

After Effects scripting 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 ECMA-262.pdf, available at www.ecma-international.org/publications/standards/Ecma-262.htm. For an overview of the most common keywords and statements available from ECMA-262, see “JavaScript keywords and statement syntax” on page8.

Elements of basic JavaScript relevant to After Effects scripting

JavaScript variables

Scripting shares a global environment, so any script executed at startup can define variables and functions that are available to all scripts. In all cases, variables and functions, once defined by running a script that contains them, persist in subsequent scripts during a given After Effects session. Once the application is quit, all such globally defined variables and functions are cleared. Scripters should be careful about giving variables in scripts unique names, so that a script does not inadvertently reassign global variables intended to persist throughout a session.

JavaScript keywords and statement syntax

Although it is not possible to provide an exhaustive resource describing usage of JavaScript, the following tables provide an overview of keywords, statements, operators, precedence, and associativity.

The following table lists and describes all keywords and statements recognized by the After Effects scripting engine.

Table1Keywords and Statement Syntax

Description

Standard JavaScript; exit the currently executing loop.

Standard JavaScript; cease execution of the current loop iteration.Label used in a switch statement.

Label used in a switch statement when a case label is not found.

Standard JavaScript construct. Similar to the while loop, except loop condition evaluation occurs at the end of the loop.

Literal representing the Boolean false value.Standard JavaScript loop construct.

Keyword/Statement

breakcontinuecasedefaultdo...whilefalsefor

8

After Effects scripting referenceElements of basic JavaScript relevant to After Effects scripting

9

Keyword/StatementDescription

Standard JavaScript construct. Provides a way to easily loop through the properties of an object.Used to define a function.

Standard JavaScript conditional constructs.Standard JavaScript constructor statement.

Assigned to a variable, array element, or object property to indicate that it does not contain a legal value.

Standard JavaScript way of returning a value from a function or exiting a function.

Standard JavaScript way of evaluating a JavaScript expression and attempting to match the expres-sion’s value to a case label.

Standard JavaScript method of indicating the current object.Literal representing the Boolean true value.

Indicates that the variable, array element, or object property has not yet been assigned a value.Standard JavaScript syntax used to declare a local variable.

Standard JavaScript construct. Similar to the do...while loop, except loop condition evaluation occurs at the beginning of the loop.

Standard JavaScript construct used to specify an object to use in subsequent statements.

for...infunctionif/if...elsenewnullreturnswitchthistrueundefinedvarwhilewith

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.

Table2

Operators

Description of Operators

DescriptionAllocate object.Deallocate object.Returns data type.Returns undefined value.Structure member.Array element.Function call.

Pre- or post-increment.Pre- or post-decrement.Unary negation or subtraction.Bitwise NOT.Logical NOT.Multiply.Divide.

newdeletetypeofvoid.[]()++–––~!*/

9

After Effects scripting referenceElements of basic JavaScript relevant to After Effects scripting

10

OperatorsDescriptionModulo division.Add.

Bitwise left shift.Bitwise right shift.

Unsigned bitwise right shift.Less than.Less than or equal.Greater than.Greater than or equal.Equal.Not equal.Bitwise AND.Bitwise XOR.Bitwise OR.Logical AND.Logical OR.

Conditional (ternary).Assignment.

Assignment with add operation.Assignment with subtract operation.Assignment with multiply operation.Assignment with divide operation.

Assignment with modulo division operation.Assignment with bitwise left shift operation.Assignment with bitwise right shift operation.

Assignment with unsigned bitwise right shift operation.Assignment with bitwise AND operation.Assignment with bitwise XOR operation.Assignment with bitwise OR operation.Multiple evaluation.

%+<<>>>>><<=>>===!=&^|&&||?:=+=–=*=/=%=<<=>>=>>>=&=^=|=,

10

After Effects scripting referenceThe After Effects Object Model

11

Table3

Operator Precedence

Associativityleft to rightright to leftleft to rightleft to rightleft to rightleft to rightleft to rightleft to rightleft to rightleft to rightleft to rightleft to rightright to leftright to leftleft to right

Operators (highest precedence to lowest)

[], (), .

new, delete, – (unary negation), !, typeof, void, ++, ––*, /, %

+, – (subtraction)<<, >>, >>><, <=, >, >===, !=&^|&&||?:

=, /=, %=, <<=, >>=, >>>=, &=, ^=, |=, +=, –=, *=,

The After Effects Object Model

As you look through this reference section, which is organized alphabetically by object, you can refer to the following diagrams for an overview of where the various objects fall within the hierarchy, and their correspon-dence to the user interface.

APPLICATIONSYSTEMFILEFOLDERSOCKETSETTINGSPROJECTCOMP)TEMITEM??S????MAY??BE??ANY??OF??THE??FOLLOWING??????TYPES??OF??ITEM??/2FOOTAGE)TEM/2FOLDER)TEMRENDER1UEUEITEM??S??LAYER??S??ITEM??S??PROXY3OURCEPROPERTIESMAIN3OURCEPROXY3OURCERENDER1UEUE)TEM??S??MAIN3OURCE??????PROXY3OURCE??MAY??BE??ANY??OF??THE??FOLLOWING??????TYPES??OF??ITEM??SOLID3OURCE/2PLACEHOLDER3OURCE/2FILE3OURCEOUTPUT-ODULE??S??COLORFILEHierarchy diagram of the main After Effects scripting objects11

After Effects scripting referenceThe After Effects Object Model

12

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.

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

“Global functions” on page14“Application object” on page17“AVItem object” on page30“AVLayer object” on page38“CameraLayer object” on page50“Collection object” on page51“CompItem object” on page52

Description

Globally available functions that allow you to display text for script debugging purposes, and help convert time values between seconds and frames.

A single global object, available by its name (app), that provides access to objects and application settings within the After Effects application. Represents audio/visual files imported into After Effects.

Represents those layers that contain AVItem objects (composition layers, footage layers, solid layers, text layers, and sound layers).Represents a camera layer within a composition.

Associates a set of objects or values as a logical group and provides access to them by index.

Represents a composition, and allows you to manipulate it and get information about it.

12

After Effects scripting referenceThe After Effects Object Model

13

Object

“FileSource object” on page61“FolderItem object” on page63“FootageItem object” on page65“FootageSource object” on page69“ImportOptions object” on page75“Item object” on page78

“ItemCollection object” on page82“KeyframeEase object” on page84“Layer object” on page86

“LayerCollection object” on page95“LightLayer object” on page100“MarkerValue object” on page102“MaskPropertyGroup object” on page106

“OMCollection object” on page109“OutputModule object” on page110

Description

Describes footage that comes from a file.Represents a folder in the Project panel.

Represents a footage item imported into a project, which appears in the Project panel. Describes the file source of some footage.

Encapsulates options for importing files into After Effects.Represents an item in a project that appears in the Project panel. Collects items in a project.

Encapsulates keyframe ease values in an After Effects property.A base class for layer classes.Collects layers in a project.

Represents a light layer within a composition.

Encapsulates marker values in an After Effects property.Encapsulates mask attributes in a layer.Collects output modules in a render queue.Represents an output module for a render queue.

“PlaceholderSource object” on page113Describes a placeholder for footage.“Project object” on page114“Property object” on page124“PropertyBase object” on page148“PropertyGroup object” on page155“RenderQueue object” on page160“RenderQueueItem object” on page163“RenderQueueItem object” on page163“RQItemCollection object” on page169“Shape object” on page172“ShapeLayer object” on page178“SolidSource object” on page179“System object” on page180“TextDocument object” on page182“TextLayer object” on page188“Viewer object” on page189

Represents an After Effects project.Represents an After Effects property.

A base class for After Effects property and property group classes.Represents an After Effects property group.Represents the After Effects render queue.Represents a renderable item in a render queue.Collects render-queue items in a render queue.Provides access to application settings and preferences.Encapsulates the outline shape information for a mask.Represents a shape layer within a composition.

Describes a solid color that is the source of some footage.Provides access to the operating system from the application.Encapsulates the text in a text layer.Represents a text layer within a composition.Represents a Composition, Layer, or Footage panel.

13

After Effects scripting referenceGlobal functions

14

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.

Global function

Description

Clears text from the Info panel.

Converts string time value to a numeric time value.Converts a numeric time value to a string time value.Writes text to the Info panel, with no line break added.Writes text to the Info panel, adding a line break at the end.When true, the specified object exists.

clearOutput()

currentFormatToTime()timeToCurrentFormat()write()writeLn()isValid()

Additional global functions for standard user I/O (alert, confirm, and prompt) and static functions for fileI/O, are defined by ExtendScript; for detailed reference information, see the JavaScript Tools Guide (available from the ExtendScript Toolkit’s Help menu).

clearOutput() global function

clearOutput()Description

Clears the output in the Info panel.

Parameters

None.

Returns

Nothing.

currentFormatToTime() global function

currentFormatToTime(formattedTime, fps, isDuration)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 page117).

ParametersformattedTimefps

The frame time value, a string specifying a number of frames in the project’s current time display format.The frames-per-second, a floating-point value.

14

After Effects scripting referenceGlobal functions

15

isDuration

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

Floating-point value, the number of seconds.

isValid() global function

isValid(obj)Description

Determines if the specified After Effects object (e.g., composition, layer, mask, etc.) still exists. Some opera-tions, such as the PropertyBase moveTo() method, might invalidate existing variable assignments to related objects. This function allows you to test whether those assignments are still valid before attempting to access them.

ParametersobjReturns

The After Effects object to check for validity.

Boolean.

Example

var layer = app.project.activeItem.layer(1);// assume layer has three masksalert(isValid(layer));// displays “true”var mask1 = layer.mask(1);var mask2 = layer.mask(2);var mask3 = layer.mask(3);

mask3.moveTo(1);// move the third mask to the top of the mask stackalert(isValid(mask1));// displays “false”; mask2 and mask3 do as well

timeToCurrentFormat() global function

timeToCurrentFormat(time, fps, isDuration)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 as 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 page117).

Parameterstimefps

The number of seconds, a floating-point value.The frames-per-second, a floating-point value.

15

After Effects scripting referenceGlobal functions

16

isDuration

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

String in the project’s current time display format.

write() global function

write(text)Description

Writes output to the Info panel, with no line break added.

ParameterstextReturns

The string to display. Truncated if too long for the Info panel.

Nothing.

Example

write(\write(\

writeLn() global function

writeLn(text)Description

Writes output to the Info panel and adds a line break at the end.

ParameterstextReturns

The string to display.

Nothing.

Example

writeln(\writeln(\

16

After Effects scripting referenceApplication object

17

Application object

appDescription

Provides access to objects and application settings within the After Effects application. The single global object is always available by its name, app.

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.

AttributesAttribute

Reference

“Application project attribute” on page26 and “Project object” on page114

Description

The current After Effects project.

project

isoLanguageversionbuildNamebuildNumberisWatchFolderisRenderEnginesettings

“Application isoLanguage attribute” on The locale (language and region) in which the applica-page22tion is running.“Application version attribute” on page29

“Application buildName attribute” on page19

The version number of the After Effects application.The name of this build of the application.

“Application buildNumber attribute” on The number of this build of the application.page20

“Application isWatchFolder attribute” on When true, the local application is running in Watch page23Folder mode.“Application isRenderEngine attribute” on page23

When true, the local After Effects application is running as a render engine.

“Application settings attribute” on Application settings that can be set via scripting.page28 and “RQItemCollection object” on page169

“Application onError attribute” on page24

“Application exitCode attribute” on page22

A callback function that is called when an error occurs in the application.

A numeric status code used when executing a script 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.

When true, the application remains open after running a script from the command line on Windows.

When true, the project is saved if the application closes unexpectedly.

onErrorexitCode

exitAfterLaunchAndEval“Application exitAfterLaunchAndEval

attribute” on page22

saveProjectOnCrashmemoryInUseeffectsactiveViewer

“Application saveProjectOnCrash attri-bute” on page27

“Application memoryInUse attribute” on Memory in use by this application.page23

“Application effects attribute” on page20

“Application activeViewer attribute” on page19

The effects available in the application.

The currently focused or last-focused viewer panel.

17

After Effects scripting referenceApplication object

18

MethodsMethod

Reference

“Application newProject() method” on page24

“Application open() method” on page24“Application quit() method” on page27“Application watchFolder() method” on page29

“Application pauseWatchFolder() method” on page26

Description

Creates a new project in After Effects.Opens a project or an Open Project dialog box.Quits the application.

Starts Watch Folder mode; does not return until Watch Folder mode is turned off.Pauses a current watch-folder process.

newProject()open()quit()

watchFolder()pauseWatchFolder()endWatchFolder()purge()

beginUndoGroup()endUndoGroup()beginSuppressDialogs()endSuppressDialogs()setMemoryUsageLimits()setSavePreferencesOnQuit()activate()scheduleTask()cancelTask()parseSwatchFile()

“Application endWatchFolder() method” on Ends a current watch-folder process.page21

“Application purge() method” on page26“Application beginUndoGroup() method” on page19

Purges a targeted type of cached information (replicates Purge options in the Edit menu).Groups the actions that follow it into a single undoable step.

“Application endUndoGroup() method” on Ends an undo group; needed only when a page21script contains more than one undo group.“Application beginSuppressDialogs() method” on page19

“Application endSuppressDialogs() method” on page21

“Application setMemoryUsageLimits() method” on page28

“Application setSavePreferencesOnQuit() method” on page28

Begins suppression of dialogs in the user inter-face.

Ends suppression of dialogs in the user inter-face.

Sets memory usage limits as in the Memory & Cache preferences area.

Sets whether preferences are saved when the application is quit.

“Application activate() method” on page18Brings the After Effects main window to the

front of the screen.“Application scheduleTask() method” on page27

“Application cancelTask() method” on page20

Schedules a JavaScript script for delayed exe-cution.

Cancels a scheduled task.

“Application parseSwatchFile() method” on Loads a color swatch from an Adobe Swatch page25Exchange (ASE) file.

Application activate() method

app.activate()Description

Opens the application main window if it is minimized or iconified, and brings it to the front of the desktop.

Parameters

None.

18

After Effects scripting referenceApplication object

19

Returns

Nothing.

Application activeViewer attribute

app.activeViewerDescription

The Viewer object for the currently focused or active-focused viewer (Composition, Layer, or Footage) panel. Returns null if no viewers are open.

Type

Viewer object; read-only.

Application beginSuppressDialogs() method

app.beginSuppressDialogs()Description

Begins suppression of script error dialog boxes in the user interface. Use endSuppressDialogs() to resume the display of error dialogs. See “Application endSuppressDialogs() method” on page21.

Parameters

None.

Returns

Nothing.

Application beginUndoGroup() method

app.beginUndoGroup(undoString)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 endUndoGroup() method to mark the end of the group. (See “Application endUndoGroup() method” on page21.)

beginUndoGroup() and endUndoGroup() 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.

ParametersundoStringReturns

The text that will appear for the Undo command in the Edit menu (that is, “Undo ”)

Nothing.

Application buildName attribute

app.buildName

19

After Effects scripting referenceApplication object

20

Description

The name of the build of After Effects being run, used internally by Adobe for testing and troubleshooting.

Type

String; read-only.

Application buildNumber attribute

app.buildNumberDescription

The number of the build of After Effects being run, used internally by Adobe for testing and troubleshooting.

Type

Integer; read-only.

Application cancelTask() method

app.cancelTask(taskID)Description

Removes the specified task from the queue of tasks scheduled for delayed execution.

ParameterstaskIDReturns

An integer that identifies the task, as returned by app.scheduleTask().

Nothing.

Application effects attribute

app.effectsDescription

The effects available in the application.

Type

Array, with each element containing the following properties; read-only:

displayNamecategorymatchName

String representing the localized display name of the effect as seen in the Effect menu.

String representing the localized category label as seen in the Effect menu. This can be \effects that aren’t normally shown to the user.

String representing the internal unique name for the effect. This name does not change between ver-sions of After Effects. Use this value to apply the effect.

Example

var effectName = app.effects[12].displayName;

20

After Effects scripting referenceApplication object

21

Application endSuppressDialogs() method

app.endSuppressDialogs(alert)Description

Ends the suppression of script error dialog boxes in the user interface. Error dialogs are displayed by default; call this method only if beginSuppressDialogs() has previously been called. See “Application beginSuppress-Dialogs() method” on page19.

Parametersalert

Boolean; when true, errors that have occurred following the call to beginSuppressDialogs() are displayed in a dialog box.

Returns

Nothing.

Application endUndoGroup() method

app.endUndoGroup()Description

Marks the end of an undo group begun with the app.beginUndoGroup() 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.

Calling this method without having set a beginUndoGroup() method yields an error.

Parameters

None.

Returns

Nothing.

Application endWatchFolder() method

app.endWatchFolder()Description

Ends Watch Folder mode.

Parameters

None.

Returns

Nothing.

21

After Effects scripting referenceApplication object

22

See also

“Application watchFolder() method” on page29“Application parseSwatchFile() method” on page25“Application isWatchFolder attribute” on page23

Application exitAfterLaunchAndEval attribute

app.exitAfterLaunchAndEvalDescription

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.

Application exitCode attribute

app.exitCodeDescription

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 command

line (using the afterfx or afterfx –m command), and a script was specified with the –r or –s option.

?in Mac OS, the value is returned as the AppleScript DoScript result for each script.

In both Mac OS and Windows, the value is set to 0 (EXIT_SUCCESS) 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

app.exitCode = 2; //on quit, if value is 2, an error has occurred

Application isoLanguage attribute

app.isoLanguageDescription

A string indicating the locale (language and regional designations) After Effects is running.NOTE: $.locale returns the operating system language, not the language of the After Effects application.

22

After Effects scripting referenceApplication object

23

Type

String; read-only. Some common values include:

?en_US for English (United States)?de_DE for German (Germany)?es_ES for Spanish (Spain)?fr_FR for French (France)?it_IT for Italian (Italy)?ja_JP for Japanese (Japan)?ko_KR for Korean (Korea)

Example

var lang = app.isoLanguage;if (lang == \

alert(\else if (lang == \

alert(\else

alert(\

Application isRenderEngine attribute

app.isRenderEngineDescription

True if After Effects is running as a render engine.

Type

Boolean; read-only.

Application isWatchFolder attribute

app.isWatchFolderDescription

True if the Watch Folder dialog box is currently displayed and the application is currently watching a folder for rendering.

Type

Boolean; read-only.

Application memoryInUse attribute

app.memoryInUseDescription

The number of bytes of memory currently used by this application.

23

After Effects scripting referenceApplication object

24

Type

Number; read-only.

Application newProject() method

app.newProject()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 app.project.close(CloseOp-tions.DO_NOT_SAVE_CHANGES) to close the current project before opening a new one. See “Project close() method” on page116.

Parameters

None.

Returns

A new Project object, or null if no new project is created.

Example

app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES);app.newProject();

Application onError attribute

app.onErrorDescription

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 page161.The callback function is passed the error string and a severity string. It should not return any value.

Type

A function name string, or null if no function is assigned; read/write.

Example

function err(errString) {alert(errString); }

app.onError = err;

Application open() method

app.open()app.open(file)

24

After Effects scripting referenceApplication object

25

Description

Opens a project.

Parametersfile

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

var my_file = new File(\if (my_file.exists){

new_project = app.open(my_file);if (new_project){

alert(new_project.file.name);}}

Application parseSwatchFile() method

app.parseSwatchFile(file)Description

Loads color swatch data from an Adobe Swatch Exchange (ASE) file.

ParametersfileReturns

The file specification, an ExtendScript File object.

The swatch data, in this format:

data.majorVersiondata.minorVersiondata.valuesSwatchValue.typeSwatchValue.rSwatchValue.gSwatchValue.bSwatchValue.cSwatchValue.mSwatchValue.ySwatchValue.k

When type = \, the color values in the range [0.0..1.0]. 0, 0, 0, 0 is White.

An array of SwatchValue.

One of \

When type = \, the color values in the range [0.0..1.0]. 0, 0, 0 is Black.

The ASE version number.

25

After Effects scripting referenceApplication object

26

SwatchValue.LSwatchValue.aSwatchValue.bSwatchValue.value

When type = \, the color values.

L is in the range [0.0..1.0]. a and b are in the range [-128.0..+128.0]0, 0, 0 is Black.

When type = \, the value range is [0.0..1.0]. 0.0 is Black.

Application pauseWatchFolder() method

app.pauseWatchFolder(pause)Description

Pauses or resumes the search of the target watch folder for items to render.

ParameterspauseReturns

True to pause, false to resume.

Nothing.

See also

“Application isWatchFolder attribute” on page23“Application watchFolder() method” on page29“Application endWatchFolder() method” on page21

Application project attribute

app.projectDescription

The project that is currently loaded. See “Project object” on page114.

Type

Project object; read-only.

Application purge() method

app.purge(target)Description

Purges unused data of the specified types from memory. Replicates the Purge options in the Edit menu.

26

After Effects scripting referenceApplication object

27

Parameterstarget

The type of elements to purge from memory; a PurgeTarget enumerated value, one of:

?PurgeTarget.ALL_CACHES: Purges all data that After Effects has cached to physical memory.?PurgeTarget.UNDO_CACHES: Purges all data saved in the undo cache.

?PurgeTarget.SNAPSHOT_CACHES: Purges all data cached as composition/layer snapshots.?PurgeTarget.IMAGE_CACHES: Purges all saved image data.

Returns

Nothing.

Application quit() method

app.quit()Description

Quits the After Effects application.

Parameters

None.

Returns

Nothing.

Application saveProjectOnCrash attribute

app.saveProjectOnCrashDescription

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.

Application scheduleTask() method

app.scheduleTask(stringToExecute, delay, repeat)Description

Schedules the specified JavaScript for delayed execution.

ParametersstringToExecutedelay

A string containing JavaScript to be executed.

A number of milliseconds to wait before executing the JavaScript. A floating-point value.

27

After Effects scripting referenceApplication object

28

repeat

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 app.cancelTask().

Application setMemoryUsageLimits() method

app.setMemoryUsageLimits(imageCachePercentage, maximumMemoryPercentage)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 32-bit Windows, 4 GB for 64-bit Windows, 3.5 GB for Mac OS.

Parameters

imageCachePercentagemaximumMemoryPercentageReturns

Floating-point value, the percentage of memory assigned to image cache.Floating-point value, the maximum usable percentage of memory.

Nothing.

Application setSavePreferencesOnQuit() method

app.setSavePreferencesOnQuit(doSave)Description

Set or clears the flag that determines whether preferences are saved when the application is closed.

ParametersdoSaveReturns

When true, preferences saved on quit, when false they are not.

Nothing.

Application settings attribute

app.settingsDescription

The currently loaded settings. See “Settings object” on page170.

Type

Settings object; read-only.

28

After Effects scripting referenceApplication object

29

Application version attribute

app.versionDescription

An alphanumeric string indicating which version of After Effects is running.

Type

String; read-only.

Example

var ver = app.version;

alert(\

Application watchFolder() method

app.watchFolder(folder_object_to_watch)Description

Starts a Watch Folder (network rendering) process pointed at a specified folder.

Parameters

folder_object_to_watchReturns

The ExtendScript Folder object for the folder to watch.

Nothing.

Example

var theFolder = new Folder(“c:/tool”);app.watchFolder(theFolder);See also

“Application endWatchFolder() method” on page21“Application parseSwatchFile() method” on page25“Application isWatchFolder attribute” on page23

29

After Effects scripting referenceAVItem object

30

AVItem object

app.project.item(index)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 page78.

?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 page52 and “FootageItem object” on page65.

AttributesAttribute

Reference

“AVItem name attribute” on page33“AVItem width attribute” on page37“AVItem height attribute” on page32“AVItem pixelAspect attribute” on page33“AVItem frameRate attribute” on page32

Description

The name of the object as shown in the Project panel.The width of the item.The height of the item.

The pixel aspect ratio of the item.The frame rate of the item.

namewidthheightpixelAspect frameRateframeDurationdurationuseProxyproxySourcetime usedInhasVideohasAudiofootageMissing

“AVItem frameDuration attribute” on page31The frame duration for the item.“AVItem duration attribute” on page31“AVItem useProxy attribute” on page36“AVItem proxySource attribute” on page34“AVItem time attribute” on page36“AVItem usedIn attribute” on page36“AVItem hasVideo attribute” on page32“AVItem hasAudio attribute” on page32“AVItem footageMissing attribute” on page31

The total duration of the item.

When true, a proxy source is used for this item.The FootageItem object used as proxy for the item.Current time of the item.

The CompItem objects that use this item.When true, the item has a video component.When true, the item has an audio component.

When true, the item cannot be found or is a placeholder.

MethodsMethod

Reference

“AVItem setProxy() method” on page34“AVItem setProxyWithSequence() method” on page35

“AVItem setProxyWithSolid() method” on page35

Description

Sets a proxy for the item.

Sets a sequence as a proxy for the item.Sets a solid as a proxy for the item.

setProxy()

setProxyWithSequence()setProxyWithSolid()setProxyWithPlaceholder()setProxyToNone()

“AVItem setProxyWithPlaceholder() method” on Sets a placeholder as a proxy for the item.page35

“AVItem setProxyToNone() method” on page34

Removes the proxy for the item.

30

After Effects scripting referenceAVItem object

31

AVItem duration attribute

app.project.item(index).durationDescription

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 duration of the composition, and is read/write. ?In a FootageItem, the value is linked to the duration of the mainSource object, and is read-only.

Type

Floating-point value in the range [0.0..10800.0]; read/write for a CompItem; otherwise, read-only.

AVItem footageMissing attribute

app.project.item(index).footageMissingDescription

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 missingFootagePath attribute of the footage item’s source-file object. See “FootageItem mainSource attribute” on page66 and “FileSource missingFootagePath attribute” on page61.

Type

Boolean; read-only.

AVItem frameDuration attribute

app.project.item(index).frameDurationDescription

Returns the length of a frame for this AVItem, in seconds. This is the reciprocal of frameRate. When set, the reciprocal is automatically set as a new frameRate value.

This attribute returns the reciprocal of the frameRate, 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 mainSource, and is read-only. To change it, set the conformFrameRate of the mainSource object. This sets both the frameRate and frameDuration of the FootageItem.

Type

Floating-point value in the range [1/99.. 1.0]; read-only for a FootageItem, otherwise read/write.

31

After Effects scripting referenceAVItem object

32

AVItem frameRate attribute

app.project.item(index).frameRateDescription

The frame rate of the AVItem, in frames-per-second. This is the reciprocal of the frameDuration. When set, the reciprocal is automatically set as a new frameDuration value.

?In a CompItem, the value is linked to the frameRate of the composition, and is read/write.

?In a FootageItem, the value is linked to the frameRate of the mainSource object, and is read-only. To change

it, set the conformFrameRate of the mainSource object. This sets both the frameRate and frameDuration of the FootageItem.

Type

Floating-point value in the range [1.0..99.0]; read-only for a FootageItem, otherwise read/write.

AVItem hasAudio attribute

app.project.item(index).hasAudioDescription

When true, the AVItem has an audio component.

?In a CompItem, the value is linked to the composition. ?In a FootageItem, the value is linked to the mainSource object.

Type

Boolean; read-only.

AVItem hasVideo attribute

app.project.item(index).hasVideoDescription

When true, the AVItem has an video component.

?In a CompItem, the value is linked to the composition. ?In a FootageItem, the value is linked to the mainSource object.

Type

Boolean; read-only.

AVItem height attribute

app.project.item(index).heightDescription

The height of the item in pixels.

?In a CompItem, the value is linked to the composition, and is read/write.

32

After Effects scripting referenceAVItem object

33

?In a FootageItem, the value is linked to the mainSource object, and is read/write only if the mainSource

object is a SolidSource. Otherwise, it is read-only.

Type

Integer in the range [1...30000]; read/write, except as noted.

AVItem name attribute

app.project.item(index).name Description

The name of the item, as shown in the Project panel.

?In a FootageItem, the value is linked to the mainSource object. If the mainSource object is a FileSource, this

value controls the display name in the Project panel, but does not affect the file name.

Type

String; read/write.

AVItem pixelAspect attribute

app.project.item(index).pixelAspect Description

The pixel aspect ratio (PAR) of the item.

?In a CompItem, the value is linked to the composition. ?In a FootageItem, the value is linked to the mainSource object.

The value you retrieve after setting may be slightly different from the value you supplied. The following table compares the value as it appears in the UI with the more-accurate value returned by this attribute.

PAR in the After Effects UI0.9111.51.091.211.331.462

PAR returned by the pixelAspect attribute0.9090909090909111.5

1.094017094017091.212121212121211.333333333333331.458689458689462

Type

Floating-point value, in the range [0.01..100.0]; read/write.

33

After Effects scripting referenceAVItem object

34

AVItem proxySource attribute

app.project.item(index).proxySource 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: setProxy(), setProxyWithSequence(), setProxyWithSolid(), or setProxyWithPlaceholder().

Type

FootageSource object; read-only.

AVItem setProxy() method

app.project.item(index).setProxy(file)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 proxySource attribute, and sets useProxy to true. It does not preserve the interpretation param-eters, 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.

ParametersfileReturns

An ExtendScript File object for the file to be used as a proxy.

None.

AVItem setProxyToNone() method

app.project.item(index).setProxyToNone()Description

Removes the proxy from this AVItem, sets the value of proxySource to null, and sets the value of useProxy to false.

Parameters

None.

Returns

Nothing.

34

After Effects scripting referenceAVItem object

35

AVItem setProxyWithPlaceholder() method

app.project.item(index).setProxyWithPlaceholder(name, width, height, frameRate, duration)Description

Creates a PlaceholderSource object with specified values, sets this as the value of the proxySource attribute, and sets useProxy 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.

Parametersnamewidth, heightframeRatedurationReturns

A string containing the name of the new object.

The pixel dimensions of the placeholder, an integer in the range [4..30000].The frames-per-second, an integer in the range [1..99].

The total length in seconds, up to 3 hours. An integer in the range [0.0..10800.0].

Nothing.

AVItem setProxyWithSequence() method

app.project.item(index).setProxyWithSequence(file, forceAlphabetical)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 proxySource attribute, and sets useProxy 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.

Parametersfile

forceAlphabeticalReturns

An ExtendScript File object for the first file in the sequence.When true, use the “Force alphabetical order” option.

Nothing.

AVItem setProxyWithSolid() method

app.project.item(index).setProxyWithSolid(color, name, width, height, pixelAspect)Description

Creates a SolidSource object with specified values, sets this as the value of the proxySource attribute, and sets useProxy to true. It does not preserve the interpretation parameters, instead using the user preferences.

35

本文来源:https://www.bwwdw.com/article/1bdg.html

Top