Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Renaming items with scripts

  • Renaming items with scripts

    Posted by Vahab San on November 5, 2018 at 7:06 pm

    Hello everyone

    Here is the situation:
    – I have an expression in comp A referring to comp B;
    – If I change the name of comp B from the project panel manually, expressions will update automatically;
    – If I change the name of comp B from the project panel by scripts, expressions will not update.

    How can I rename the comp B with script and expressions update automatically?

    Cheers

    Vahab San replied 7 years, 6 months ago 2 Members · 3 Replies
  • 3 Replies
  • Walter Soyka

    November 5, 2018 at 8:23 pm

    Try it like this:

    var originalCompName = "Comp B";
    var newCompName = "Comp C";

    myComp.name = newCompName;
    app.project.autoFixExpressions(originalCompName, newCompName);

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Walter Soyka

    November 5, 2018 at 8:57 pm

    And to clarify what it does… autoFixExpressions(oldText, newText) will identify all broken expressions, do a search and replace within them (swapping out oldText for newText), and committing that change if it fixes the break.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Vahab San

    November 6, 2018 at 8:07 am

    Walter

    Thank you very much.
    Worked perfectly. And again thank you for the explanation.

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