-
Convert Selected Keyframes to Markers with custom label(marker color)
I want a slightly modified version of the in-built script Convert Selected Properties to Markers.jsx.
I want the markers created to be color Red for example and the marker comment to be empty and duration 0:00:00:00.
I used chatgpt and provided me with this;
var selectedProperty = app.project.activeItem.selectedProperties[0];
var markerStream = selectedProperty.propertyGroup(1).property(“Marker”); // Get the marker stream of the selected property
for (var i = 1; i <= selectedProperty.numKeys; i++) {
var keyTime = selectedProperty.keyTime(i);
var markerValue = new MarkerValue(“”); // Empty comment
markerValue.label = 14; // Set the marker’s label color to red (index 14)
markerStream.setValueAtTime(keyTime, markerValue);
}
but when run the scriptlet (using Kbar > Run Scriptlet), I get the error
“unable to execute script at line 11. null is not an object”
Please help me. 🙏🙏