Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions If a hyphen-sign appears two times or more in source text enable layer

  • If a hyphen-sign appears two times or more in source text enable layer

    Posted by Niels b Nielsen on May 11, 2018 at 9:55 pm

    How do I make a layer appear (opacity 100 else 0) if If a hyphen (-) sign appears two times or more in source text? I will need an expression to look for and count the number of hyphen signs in a source text. How can I do this?

    Niels b Nielsen replied 8 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 11, 2018 at 11:09 pm

    Something like this should work:

    txt = text.sourceText;
    if (txt.split(“-“).length > 2) 100 else 0

    Dan

  • Niels b Nielsen

    May 14, 2018 at 9:34 am

    Yes, it works. Thanks Dan!

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