MarkerValue object

new MarkerValue(comment, chapter, url, frameTarget, cuePointName, params)
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 comment are optional. All arguments are strings that set in the corre-

sponding attributes of the returned MarkerValue object, except params. This is an array containing key-value

pairs., which can then be accessed with the getParameters() and setParameters() 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 Marker AE property of the layer:

layerObject.property("Marker").setValueAtTime(time, markerValueObject);

For information on the usage of markers see “Using markers” in After Effects Help.

Attributes
Methods
Examples

- To set a marker that says “Fade Up” at the 2 second mark: var myMarker = new MarkerValue("Fade Up"); myLayer.property("Marker").setValueAtTime(2, myMarker);

Attribute Reference Description
comment “MarkerValue comment attribute” on
page 103
A comment on the associated layer.
duration “MarkerValue duration attribute” on
page 103
The amount of time represented by the marker.
chapter “MarkerValue chapter attribute” on
page 103
A chapter link reference point for the associated layer.
cuePointName “MarkerValue cuePointName attribute”
on page 103
The Flash Video cue point name.
eventCuePoint “MarkerValue eventCuePoint attribute”
on page 104
Whether the Flash Video cue point is for an event or navigation.
url “MarkerValue url attribute” on page 105 A URL for Web page to be associated with the layer.
frameTarget “MarkerValue frameTarget attribute” on
page 104
A specific frame target within the Web page specified by url.
Method Reference Description
getParameters() “MarkerValue getParameters() method”
on page 104
Retrieves the key-value pairs associated with the marker value.
setParameters() “MarkerValue setParameters() method”
on page 104
Sets the key-value pairs associated with the marker value.

103

After Effects scripting reference MarkerValue object

- To get comment values from a particular marker: var commentOfFirstMarker = app.project.item(1).layer(1).property("Marker").keyValue(1).comment; var commentOfMarkerAtTime4 = app.project.item(1).layer(1).property("Marker").valueAtTime(4.0,true).comment var markerProperty = app.project.item(1).layer(1).property("Marker"); var markerValueAtTimeClosestToTime4 = markerProperty.keyValue(markerProperty.nearestKeyIndex(4.0)); var commentOfMarkerClosestToTime4 = markerValueAtTimeClosestToTime4.comment;

MarkerValue chapter attribute
app.project.item(index).layer(index).property("Marker").keyValue(index).chapter
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.

MarkerValue comment attribute
app.project.item(index).layer(index).property("Marker").keyValue(index).comment
Description

A text comment for this marker. This comment appears in the Timeline panel next to the layer marker.

Type

String; read/write.

MarkerValue cuePointName attribute
app.project.item(index).layer(index).property("Marker").keyValue(index).cuePointName
Description

The Flash Video cue point name, as shown in the Marker dialog box.

Type

String; read/write.

MarkerValue duration attribute
app.project.item(index).layer(index).property("Marker").keyValue(index).duration
Description

The marker’s duration, in seconds. The duration appears in the Timeline panel as a short bar extending from

the marker location.

Type

Floating point; read/write.

104

After Effects scripting reference MarkerValue object
MarkerValue eventCuePoint attribute
app.project.item(index).layer(index).property("Marker").keyValue(index).eventCuePoint
Description

When true, the FlashVideo cue point is for an event; otherwise, it is for navigation.

Type

Boolean; read/write.

MarkerValue frameTarget attribute
app.project.item(index).layer(index).property("Marker").keyValue(index).frameTarget
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.

MarkerValue getParameters() method
app.project.item(index).layer(index).property("Marker").keyValue(index).getParameters()
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.

MarkerValue setParameters() method
app.project.item(index).layer(index).property("Marker").keyValue(index).setParameters(keyValuePairs)
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
keyValuePairs An object containing the key-value pairs as attributes and values. The object’s toString()
method is called to assign the string value of each attribute to the named key.

105

After Effects scripting reference MarkerValue object
Returns

Nothing.

Example
var mv = new MarkerValue("My Marker");
var parms = new Object;
parms.timeToBlink = 1;
parms.assignMe = "A string"
mv.setParameters(parms);
myLayer.property("Marker").setValueAtTime(2, mv);
MarkerValue url attribute
app.project.item(index).layer(index).property("Marker").keyValue(index).url
Description

A URL for this marker. This URL is an automatic link to a Web page.

Type

String; read/write.