duplicate project item

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
explorer
Posts: 17
Joined: March 1st, 2007, 11:12 pm
Location: Poland, Warsaw

hi

i'm new to ae scripting but i got some of my scripts working somehow.
now i'm dealing with a problem: how to duplicate a project item?

i've seen in the scripting guide a way to duplicate a layer, and i tried different modifications of that to duplicate the project item, but i just cant get it to work.

any one can help?
and i just hope that the duplicate() function returns a index of the duplicated item, am i right?

oh. and btw... is there a way to add a Event Listener to AE7? for example... i have a script in Startup folder that creates a folder structure that i like to work in, but when i go to File > New project i loose it and i have to run the script by hand. is there a way to set the script to listen for event "New project" and then execute?
nab
Posts: 203
Joined: November 29th, 2005, 3:00 am
Location: Royan
Contact:

Hey explorer,

1.

Code: Select all

app.project.item(1).duplicate();
returns a CompItem object if item 1 is a comp.

2. I don't think so
explorer
Posts: 17
Joined: March 1st, 2007, 11:12 pm
Location: Poland, Warsaw

i tried that and it didn't work. thats why i writing to you. i get that duplicate() is undefined. what should i do?
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

Hi explorer,

Is the topmost (first) item in the Project panel a composition? If not, it's expected that duplicate() won't work as it's defined only for CompItem objects (i.e., compositions), not for folder or footage items.

If the first item is a comp, maybe you're using an earlier version of AE that doesn't support it? I don't have a copy of 6.0 here, but it does work in 6.5 and 7.0.

Hope that helps.

Jeff
explorer
Posts: 17
Joined: March 1st, 2007, 11:12 pm
Location: Poland, Warsaw

i have AE7.0, and what im trying to do is to automate something that i do. first step is to select a footage in the project window, duplicate it and change its interpretation. i got everything figured out but i can't duplicate the item.
Post Reply