Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to retrieve language specific letters in if else statement

  • How to retrieve language specific letters in if else statement

    Posted by Piotr Wojtczak on September 26, 2016 at 8:21 am

    Hello gyus,
    I’m preparing AE template for a client and I want the lower thirds to be edited directly from Premiere Pro via dynamic links. I use SourceRectAtTime() function to generate background for text and everything is but the problem happens, when I have Polish language specific letters Ó, Ż, Ć, Ń.

    Basically what I want is to lower the position of the shape when the test include one of those language specific letter. How do I retrieve them in if esle statemanet?

    I imagine an expression on x position value of a shape like this:
    if (thisLayer.textSource include Ó,Ż,Ń,Ć) "new x position value" else "old x position value"

    Am I thinking in a good way? I would be really grateful for help.

    Cheers!

    if (thisLayer.textSource include Ó,Ż,Ń,Ć) "new x position value" else "old x position value"

    Piotr Wojtczak replied 9 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Xavier Gomez

    September 27, 2016 at 10:03 pm

    You can use indexOf, as many times as there are letters to test:

    str = thisLayer.textSource.value;
    if (str.indexOf("Ó")>=0 || str.indexOf("Ż")>=0 || str.indexOf("Ń")>=0 || str.indexOf("Ć")>=0){
    thisValue;
    }
    else{
    thatValue;
    };

    If you like it short, this also works:

    if (RegExp("\[ÓŻŃĆ\]").test(thisLayer.textSource.value)) thisValue else thatValue;

    Xavier

  • Piotr Wojtczak

    October 11, 2016 at 7:23 am

    Thanks a lot!

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