Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linking Text Sources based on Comp and Layer Numbers

  • Linking Text Sources based on Comp and Layer Numbers

    Posted by Daniel Gillies on February 7, 2019 at 9:34 pm

    I have a set of Comps for a series of title cards, “1_Name Template,” “2_Name Template,” “3_Name Template,” etc…

    I am attempting to parse the number from each comp name, and pull Source Text from “Name Title Comp” from layers named,

    “1_Name” and “1_Title”

    “2_Name” and “2_Title”

    I can’t quite figure out how to port an expressed number value into a layer name.

    Pardon my lack of eloquence, I’m fairly new to this and having a hard time describing my efforts.

    Thanks!

    compNum = parseInt(thisComp.name);

    comp("Name Title Comp").layer(compNum"_Name").text.sourceText

    Daniel Gillies – Danger Media, LLC.
    Editorial / Motion Graphics / And Stuff
    :: da*********@**.com
    :: https://linkd.in/1mJsdIo
    :: https://vimeo.com/dgillies/2014reel

    Daniel Gillies replied 7 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 7, 2019 at 10:45 pm

    I think I’d do it like this:

    compNum = thisComp.name.split(“_”)[0];
    comp(“Name Title Comp”).layer(compNum + “_Name”).text.sourceText

    Dan

  • Daniel Gillies

    February 8, 2019 at 7:18 pm

    Worked fantastically, Thanks so much!

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