Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions [SCRIPT] Choosing the folder destination when duplicating a comp

  • [SCRIPT] Choosing the folder destination when duplicating a comp

    Posted by David Delayat on August 17, 2016 at 5:05 pm

    Hi everyone !
    I’m working on a script that duplicates comps and changes the text layers in it with datas from excel sheets. Everything works fine, but I would like to make the project “readable”, because the script creates 500 comps, divided in 30 topics. So I need, when it created a comp, to store it in a previously created folder. Any idea to access it ? It would be a kind of “selection” attribute, but writable.

    Thanks a lot 🙂

    David

    David Delayat replied 9 years, 9 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    August 17, 2016 at 6:20 pm

    Assuming that you have a variable referencing the folder object, it would be like this:

    myComp.parentFolder = myFolder;

    Dan

  • David Delayat

    August 17, 2016 at 6:23 pm

    I found something interesting by looking in the data navigator on Extendscript !
    My compItem has an attribute named “parentFolder”, which is R/W.
    When I create folders, I’m storing them into an array, so I can access them by an index.
    I just have to set myComp.parentFolder to myFolders[i].id and the job’s done !

    Thanks all ! Sometimes writting down the question helps finding the answer 🙂

    myFolders.push(app.project.items.addFolder(folderName)) ;
    myComp.parentFolder = myFolders[0].id ;

  • David Delayat

    August 17, 2016 at 6:25 pm

    Thanks a lot Dan ! I was writing my answer at the same time. I tryed your solution without the “Folder.id” and it works well !

    Have a nice day 🙂

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy