-
Copy selected property to a Null Layer's Position
I’m trying to write a script that will copy keyframes from a selected property to the position property of a new null. For example, in the image below I want to select Point1 keyframes from the Lockdown effect and have them copied to a null layer’s position with the name “Point1”.
I am having a tough time getting the script to paste just the keyframes to the position value of the null instead of pasting the entire Lockdown effect.
I have disabled the naming part of the script…can’t get it to work.
app.beginUndoGroup("Copy to Null");
{
app.executeCommand(19); //copy
var controller = app.project.activeItem.layers.addNull(); //Create null
//myProp = app.project.item[0].layer[0].selectedProperties.name; //Selected property name
controller.name = "myProp"; //Name null
controller.enabled = true;
nullLayer.property("position");
app.executeCommand(20); //paste
}
app.endUndoGroup();