-
Script to duplicate and offset layers
This is my first post on creative cow. I’ve used it as a resource for years now whenever I need help with something in after effects. Now I finally have a question that I think is a little too specific for searching the forums for.
I do not know scripting for after effects — at all. I thought it would be nice to know how to create some basic scripts to automate a few tedious actions I have to do on a daily basis. The first thing I would like to try to write a script for is to duplicate a layer multiple times at once.
To be more specific, I want to automate faking 3D text by duplicating and offsetting the anchor point of a layer of text a number of times.
Like I said before, I don’t know the first thing about scripting. Having the ability to control the number of times the layer is duplicated and offset would be nice, but not necessary. If I could have a set of 3 different scripts that duplicated and offset the layer 3 different amounts, that would be just as helpful. Also automating the next step I always take, parenting all of the duplicate layers to the original, would also be nice. Again, not a deal breaker if it’s too complicated.
I did some sniffing around in the After Effects CS3 scripting guide, and came across this line of code:
app.project.item(index).layer(index).duplicate( )
But that’s about as far as I got. I attempted to run that line of code as a script in AE but got an error saying I hadn’t defined “index”. I realize I’m probably missing plenty of common sense when it comes to scripts; I’m just completely in the dark as I’ve never messed with it before.So my first question is, how likely is it that the task I’d like to automate is something simple enough for me to attempt to learn how to start scripting on? And if it is a good place to start, is anyone willing to help me write it up?
Thanks very much,
Jake