Check if marker exists
Moderator: Paul Tuersley
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
Scripting only has access to layer markers, not comp markers. Here's an example that will find if there's a layer marker at the current time when one layer is selected in a comp:
Code: Select all
var activeItem = app.project.activeItem;
if (activeItem instanceof CompItem && activeItem.selectedLayers.length == 1) {
var theLayer = activeItem.selectedLayers[0];
var markerProp = theLayer.property("ADBE Marker");
if (markerProp.numKeys > 0) {
if (markerProp.keyTime(markerProp.nearestKeyIndex(activeItem.time)) == activeItem.time) {
alert("There's a marker on this frame");
} else {
alert("No marker on this frame");
}
}
}