FORUMS: list search recent posts

Adding selected item in project panel to a comp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Shahrokh Jahanzadeh
Adding selected item in project panel to a comp
on Aug 17, 2013 at 1:22:19 pm

Hi there...
I have a simple question
I looked over the internet and I didn`t find my answer but this post helped me a little: http://forums.creativecow.net/thread/227/17300

here is my question: How can I add a selected footage from project panel to a comp with scripts???

Shahrokh


Return to posts index

Dan Ebberts
Re: Adding selected item in project panel to a comp
on Aug 17, 2013 at 4:09:12 pm

Something like this:

var myComp = app.project.activeItem;


var myComp = app.project.activeItem;

for(var i = 1; i <= app.project.numItems; i++){
if ((app.project.item(i) instanceof FootageItem) && app.project.item(i).selected){
myComp.layers.add(app.project.item(i));
}
}



Dan



Return to posts index

Shahrokh Jahanzadeh
Re: Adding selected item in project panel to a comp
on Aug 18, 2013 at 4:39:27 am

Thanks Dan.

this code worked perfectly but there is a new problem...

your codes worked when we selected Comp panel or timeline panel
and when I added this new line in top, it didn`t work because the project panel will select.
app.project.importFileWithDialog();

How we can fix it?

Shahrokh


Return to posts index


Dan Ebberts
Re: Adding selected item in project panel to a comp
on Aug 18, 2013 at 5:48:13 am

Did you try making your new line the second line? If that won't work for you, I guess you'll have to go through the project bin and find your comp by name.



Return to posts index

Shahrokh Jahanzadeh
Re: Adding selected item in project panel to a comp
on Aug 18, 2013 at 5:56:09 am

Oh my GOD...
No I didn`t try, I really forgot this one...
that way worked perfectly
You are the BEST

thanks Dan

Shahrokh


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]