javascript
app.project.sequences[index].markers
app.project.rootItem.children[index].getMarkers()
The MarkerCollection object represents a collection of Marker objects <marker>
in a projectItem
and sequence
.
MarkerCollection is a subclass of
collection
. All methods and attributes of Collection, in addition to those listed below, are available when working with MarkerCollection.
app.project.sequences[index].markers.numMarkers
app.project.rootItem.children[index].getMarkers().numMarkers
Description
The count of marker objects in the project item or sequence.
Type
Integer, read-only.
app.project.sequences[index].markers.createMarker(time)
app.project.rootItem.children[index].getMarkers().createMarker(time)
Description
Create a new marker
on a project item or a sequence.
Parameters
Argument | Type | Description |
---|---|---|
time |
Float |
A time, in seconds, where marker should be created. |
Returns
marker
if successful.
app.project.sequences[index].markers.deleteMarker(marker)
app.project.rootItem.children[index].getMarkers().deleteMarker(marker)
Description
Remove a given marker object from a collection.
Parameters
Argument | Type | Description |
---|---|---|
marker |
marker |
A marker object to remove from collection. |
Returns
Boolean
.
Examples
Remove all markers from the active sequence
var markers = app.project.activeSequence.markers;
var marker = markers.getFirstMarker();
var count = markers.numMarkers;
while (marker) {
markers.deleteMarker(marker);
marker = markers.getFirstMarker();
}
alert('Removed ' + count.toString() + ' markers');
app.project.sequences[index].markers.getFirstMarker()
app.project.rootItem.children[index].getMarkers().getFirstMarker()
Description
Retrieve the first marker object, sorted by time in seconds, on a given project item or sequence.
Parameters
None.
Returns
marker
or undefined
.
app.project.sequences[index].markers.getLastMarker()
app.project.rootItem.children[index].getMarkers().getLastMarker()
Description
Retrieve the very last marker object, sorted by time in seconds, on a given project item or sequence.
Parameters
None.
Returns
marker
or undefined
.
app.project.sequences[index].markers.getNextMarker(currentMarker)
app.project.rootItem.children[index].getMarkers().getNextMarker(currentMarker)
Description
Get the next available marker, sorted by seconds, starting from a given one.
Parameters
Argument | Type | Description |
---|---|---|
currentMarker |
marker |
A starting marker object, from which to get a next one. |
Returns
marker
or undefined
.
app.project.sequences[index].markers.getPrevMarker(currentMarker)
app.project.rootItem.children[index].getMarkers().getPrevMarker(currentMarker)
Description
Get the previous available marker, sorted by seconds, starting from a given one.
Parameters
Argument | Type | Description |
---|---|---|
currentMarker |
marker |
A starting marker object, from which to get a previous one. |
Returns
marker
or undefined
.