scripting changes in After Effects CS5.5
other useful scripting posts:
- scripting changes in After Effects CS6, plus new scripting guide
- After Effects CS5 scripting changes blog post
- After Effects CS4 scripting changes blog post
- After Effects CS3 Scripting Guide
Check out the “Scripts” section of After Effects Help on the Web, which provides links to useful scripting resources. You can also search the After Effects Help document and After Effects Community Help for specific scripts.
Changes to bundled scripts, script execution, and script loading
- Added Double-Up.jsx script to the set of scripts included with After Effects. To run this script, choose it from the File > Scripts menu. This script duplicates the selected layer and places the duplicate alongside the original in a single composition. This is useful for setting up side-by-side comparisons of effects and various settings for a layer.
- New on Mac OS: You can select .jsxbin files from the File > Scripts > Run Script File dialog box.
- The Scripts folder can now be an alias or shortcut, pointing to a different folder that actually contains the scripts.
Changes to After Effects scripting language
changes related to timecode and time display format
- removed from Project object:
timecodeDisplayType
attributetimecodeBaseType
attributetimecodeNTSCDropFrame
attributetimecodeFilmType
attributeTimecodeDisplayType
enum
TimecodeFilmType
enum
TimecodeBaseType
enum
- The
timeToCurrentFormat
scripting method matches results returned using thetimeToCurrentFormat
expression method. - The Project object’s
displayStartFrame
attribute is now a read/write integer with accepted values of 0 and 1. - Added read/write
dropFrame
attribute to the CompItem object. ThedropFrame
attribute is a Boolean value that indicates whether the composition is drop-frame or non-drop-frame, corresponding to the setting in the Composition Settings dialog box.
example:
app.project.item(1).dropFrame = true;
- Added
framesCountType
attribute to Project object. TheframesCountType
attribute is a read/write enumerated value representing the the setting in the Frame Count menu in the Project Settings dialog box.- framesCountType.FC_START_1
- framesCountType.FC_START_0
- framesCountType.FC_TIMECODE_CONVERSION
example:
app.project.framesCountType = FramesCountType.FC_TIMECODE_CONVERSION;
- Added
feetFramesFilmType
attribute to Project object. ThefeetFramesFilmType
attribute is a read/write enumerated value representing the setting in the Use Feet + Frames menu in the Project Settings dialog box. Use this attribute instead of the oldtimecodeFilmType
attribute.- feetFramesFilmType.MM16
- feetFramesFilmType.MM35
example:
app.project.feetFramesFilmType = FeetFramesFilmType.MM35;
- Added
framesUseFeetFrames
attribute to Project object. TheframesUseFeetFrames
attribute is a read/write Boolean value representing the state of the Use Feet + Frames checkbox in the Project Settings dialog box.
example:
app.project.framesUseFeetFrames = true;
- Added
footageTimecodeDisplayStartType
attribute to the Project object. ThefootageTimecodeDisplayStartType
attribute is a read/write enumerated value representing the value of the Footage Start Time setting in the Project Settings dialog box, which is enabled when Timecode is selected as the time display style.- footageTimecodeDisplayStartType.FTCS_START_0
- footageTimecodeDisplayStartType.FTCS_USE_SOURCE_MEDIA
example:
app.project.footageTimecodeDisplayStartType =
FootageTimecodeDisplayStartType.FTCS_USE_SOURCE_MEDIA; - Added
timeDisplayType
attribute to the Project object. ThetimeDisplayType
attribute is a read/write enumerated value representing the time display style, corresponding to the Time Display Style section in the Project Settings dialog box.- TimeDisplayType.FRAMES
- TimeDisplayType.TIMECODE
example:
app.project.timeDisplayType= TimeDisplayType.TIMECODE;
changes related to text layers
- Added
addBoxText
method to the LayerCollection object. TheaddBoxText
method creates a new paragraph text layer. TheaddBoxText
method takes one or two parameters:- (required) Array of two values specifying the width and height of the paragraph, in pixels. The new paragraph box is created centered on the anchor point.
- (optional) Text string to use as the paragraph text.
example:
var paraText = myComp.layers.addBoxText([960, 540], "After Effects CS5.5");
- Added
boxText
attribute to TextDocument object. TheboxText
attribute is a read-only Boolean value that is true if a text layer is a layer of paragraph text.
example:
var isParaText = textLayer.text.sourceText.value.boxText;
- Added
pointText
attribute to TextDocument object. ThepointText
attribute is a read-only Boolean value that is true if a text layer is a layer of point text.
example:
var isPointText = textLayer.text.sourceText.value.pointText;
- Added
boxTextSize
attribute to TextDocument object. TheboxTextSize
attribute is a read-write array ([width, height]) specifying the size of a paragraph text layer. Produces an error if used on a layer of point text or path text.
example:
var paraTextProps = textLayer.text.sourceText.value;
paraTextProps.boxTextSize = [150, 150];
textLayer.text.sourceText.setValue(paraTextProps);
miscellaneous
- Added lightType attribute to the Layer object. The lightType attribute is a read/write enumerated value representing a light layer’s light type. Trying to set the attribute on a non-light layer produces an error.
- lightType.PARALLEL
- lightType.SPOT
- lightType.POINT
- lightType.AMBIENT
example:
spotlightLayer.lightType = LightType.SPOT;
- If the RenderQueueItem object’s
duplicate
method is used on an item with the status “Done”, the method sets the new item’s status to “Queued”. This matches the behavior of duplicating a render item using the standard After Effects graphical user interface. - Added read-only
effects
attribute to the Application object. Theeffects
attribute is an array, with each element containing the following properties:displayName
: string representing the localized display name of the effect as seen in the Effect menucategory
: a string representing the localized category label as seen in the Effect menu. This can be""
for synthetic effects that aren’t normally shown to the user.matchName
: a string representing the internal unique name for the effect. This name does not change between versions of After Effects. Use this value to apply the effect.
example:
var effectName = app.effects[12].displayName;