-
Script to set a Keyframe at current time
Hi all! I need some help creating a script to add a keyframe on a selected layer.
I already have one that works but this only works for position, rotation, scale or opacity. I need this script to add the keyframe on a slider control in the selected layer called HandShape.
Here’s the script I got:
var MyComp = app.project.activeItem;
if(MyComp && MyComp.selectedLayers.length > 0){
for(var i = 0 ; i < MyComp.selectedLayers.length; i++){
var currentLayer = MyComp.selectedLayers[i];
currentLayer.property(myProperty = “rotation”).setValueAtTime(MyComp.time,myValue = 5);
};
}else{
alert(“At least one layer must be selected”);
};Thanks for taking the time to read this, hopefully someone out there can solve it!