Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Counting text fields that are not empty in an AE Essential Graphics template within Premiere

  • Counting text fields that are not empty in an AE Essential Graphics template within Premiere

    Posted by Mikael Holmström on February 12, 2018 at 1:05 pm

    Hi again,

    I’m still trying to figure out how to get this AE Essential Graphics template to work in Premiere Pro.

    I have a three input fields in the template: the text.textSource of text layer “Heading 1 Line 1”, “Heading 1 Line 2” and “Heading 1 Line 3”.

    Everything works fine in AE, but the code below that is supposed to return the number of text fields that has content, “crashes” when I open the template in Premiere.

    Anyone has any idea how to fix this?

    Thanks
    Mikael

    n = 3;
    t1 = thisComp.layer("Heading 1 Line 1").text.sourceText;
    t2 = thisComp.layer("Heading 1 Line 2").text.sourceText;
    t3 = thisComp.layer("Heading 1 Line 3").text.sourceText;
    if (t3 == "") {n = 2}
    if (t2 == "" && t3 == "") {n = 1}
    n

    Mikael Holmström replied 8 years, 5 months ago 1 Member · 1 Reply
  • 1 Reply
  • Mikael Holmström

    February 12, 2018 at 1:36 pm

    I thought I found a workaround by checking the width of each layer instead of if they are empty or not. I’m a bit surprised that this didn’t do the trick. 🙁

    n = 3;
    t1 = thisComp.layer("Heading 1 Line 1").sourceRectAtTime().width;
    t2 = thisComp.layer("Heading 1 Line 2").sourceRectAtTime().width;
    t3 = thisComp.layer("Heading 1 Line 3").sourceRectAtTime().width;
    if (t3 == 0) {n = 2}
    if (t2 == 0 && t3 == 0) {n = 1}
    n

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