Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions item arrange script

  • item arrange script

    Posted by Rainier Raydán on May 22, 2017 at 8:32 pm

    Hi! I’m trying to write a script that rearrange my items but I cant get it work… I have this:
    app.beginUndoGroup("undo");

    var proj = app.project;

    function findPrecompFolder(){
    for(var i=1;i

    I know the function is finding the compitems becouse a set before an alarm and I got all fo the comps but for some reason I cant get this working...

    Rainier Raydán replied 8 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Xavier Gomez

    May 23, 2017 at 10:32 am

    The line : moveToFolder (curItem, findPrecompFolder ()) … is very wrong, because moveToFolder 1st argument is an array and you pass it a project item object, and also because you run the findPrecompFolder () as many times as there are comps in your project, while you only need to find it once (for a big project with thousands of items this would be extremely slow).

    Xavier

  • Rainier Raydán

    May 23, 2017 at 10:50 am

    And what do I have to do? Sorry, I’m a beginner and I’m trying to learn

  • Xavier Gomez

    May 23, 2017 at 11:48 am

    It’s a bit strange that the findPrecomps function calls moveToFolder().

    One would expect that the findPrecomps function returns an array of precomps (your function returns nothing), and that the moveToFolder function is called on the result of findPrecomps(), something like:

    moveToFolder(findPrecomps());

    Xavier

  • Rainier Raydán

    May 23, 2017 at 11:54 am

    Indeed! I just change a bit the script and it works. Later on I l’ll paste it here.

    Thanks!!

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