Set keyframe at current time for highlighted property?

What type of scripts do you need?

Moderator: byronnash

Post Reply
rawenek
Posts: 1
Joined: November 6th, 2014, 4:45 am

November 6th, 2014, 11:04 am

Hello,

i was wondering if its possible to create a script or something that when executed would set a keyframe at the current time for the currently selected/highlighted property (selected in timeline or in effects controls)

Obviously the idea is to then hotkey that script and be able to quickly set keyframes for any property without having to always mouseclick the keyframe button or fake value change to trigger autokey whenever dealing with keyframing properties that dont have inbuilt hotkeys for it like pos/rot/scale/opacity do.

Unless iam missing something (i went thru the hotkey config file and couldnt find anything relevant), this would greatly speed up any more complex keyframing, cant believe its not already part of ae by now
Dan Ebberts
Posts: 319
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

November 6th, 2014, 3:05 pm

Something like this should work:

Code: Select all

var myComp = app.project.activeItem;
if (myComp && (myComp instanceof CompItem)){
	var myProps = myComp.selectedProperties;
	if (myProps.length > 0){
		for (var i = 0; i < myProps.length; i++){
			if (myProps[i].canVaryOverTime){
				myProps[i].addKey(myComp.time);
			}
		}
	}else{
		alert("No selected properties.");
	}
}else{
	alert ("No comp selected.");
}

Dan
Post Reply