Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Name a comp using first layer’s name in that comp

  • Name a comp using first layer’s name in that comp

    Posted by Julien Des on March 22, 2012 at 2:35 pm

    Hello,
    A friend needs to build a batch of comps. Is it possible that a script automatically renames all the comps of the project using the name of a layer included at the top of everyone of these comps ?

    Julien Des replied 14 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 22, 2012 at 3:24 pm

    This should do it:


    {
    for (var i = 1; i <= app.project.numItems; i++)
    if (app.project.item(i) instanceof CompItem)
    app.project.item(i).name = app.project.item(i).layer(1).name;
    }

    Dan

  • Julien Des

    March 22, 2012 at 5:37 pm

    thx a lot, it works !
    only thing is I need to apply the script several times to have to batch of comps entirely renamed
    and there is no error.
    maybe a limit value somewhere ? or should I avoid standard name for comps ?
    such as :

    “Composition 1
    Composition 2
    …”

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