ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Niels B Nielsen
If a hyphen-sign appears two times or more in source text enable layer
on May 11, 2018 at 9:55:30 pm
Last Edited By Niels B Nielsen on May 11, 2018 at 9:57:15 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?


Return to posts index

Dan Ebberts
Re: If a hyphen-sign appears two times or more in source text enable layer
on May 11, 2018 at 11:09:18 pm

Something like this should work:

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


Dan



Return to posts index

Niels B Nielsen
Re: If a hyphen-sign appears two times or more in source text enable layer
on May 14, 2018 at 9:34:15 am

Yes, it works. Thanks Dan!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]