Skip to content

Instantly share code, notes, and snippets.

@benwurth
Created September 21, 2013 01:12
Show Gist options
  • Save benwurth/6646000 to your computer and use it in GitHub Desktop.
Save benwurth/6646000 to your computer and use it in GitHub Desktop.
Simple After Effects Script that moves the markers from an AV layer to a new null layer.
app.beginUndoGroup("Move Markers to Null"); //begins the undo group
//Variables
var curItem = app.project.activeItem; //creates a variable that holds the selected comp
var curLayer = curItem.selectedLayers[0]; //creates a variable that holds the selected layer
var oldMarkers = curLayer.property("Marker");
function main()
{
var nullLayer = curItem.layers.addNull(curItem.duration); //create our null object
for (i=1; i<=oldMarkers.numKeys; i++)
{
nullLayer.property("Marker").setValueAtTime(oldMarkers.keyTime(i), oldMarkers.keyValue(i));
}
}
main(); //main function
app.endUndoGroup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment