Forums › Adobe After Effects Expressions › Create Script to Add loopOut() Expression to Layer
Create Script to Add loopOut() Expression to Layer
Brandon Smith
February 6, 2013 at 5:57 pmI was told to post this here so I can get some better help with this script I am trying to write. I am a beginner with scripting right now and I am trying to start off with just creating simple shortcut scripts that I can use in AE.
One that I am trying to make is a script that will add the loopOut() expression to the position of a selected Layer that is already keyframed.
Here is the code I have so far (see below)
Any help is greatly appreciated.
Thanks,
Brandonvar myComp = app.project.activeItem;
var myLayer = myComp.selectedLayers[0];
var prop = myLayer.transform.position;
prop.expression = "loopOut("cycle")";
prop.expressionEnabled = true;Dan Ebberts
February 6, 2013 at 8:01 pmI think you’ll need to change the line with the expression, like this:
prop.expression = ‘loopOut(“cycle”)’;
but otherwise I think it will work.
Dan
Log in to reply.