Adobe After Effects Forum
Can you fix my Script?
Can you fix my Script?
by Mariano Garcia on Jul 31, 2019 at 6:02:43 pm

Hello! I'm trying to create an After Effects script that changes the position of the first layer of every comp in my project.

Here's my current script:
var theComp = app.project.items;

var theLayer = theComp.layer(1);

var changePos = theLayer.position;



It works when I put "activeItem" but not with "Items"

Re: Can you fix my Script?
by Tomas Bumbulevičius on Aug 1, 2019 at 8:55:17 am

Hey Mariano, there is no such direct object access as 'items'.

What you need to do instead:
1. Loop through all project items or some specific of your choice (containing in some project panel folder or selection)
2. Check if the type of an item is a comp.
3. Do the action as above.

Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer - Dynamic Text Boxes Template with a Live Preview