FORUMS: list search recent posts

How to retrieve language specific letters in if else statement

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Piotr Wojtczak
How to retrieve language specific letters in if else statement
on Sep 26, 2016 at 8:21:35 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"


Return to posts index

Xavier Gomez
Re: How to retrieve language specific letters in if else statement
on Sep 27, 2016 at 10:03:48 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


Return to posts index

Piotr Wojtczak
Re: How to retrieve language specific letters in if else statement
on Oct 11, 2016 at 7:23:42 am

Thanks a lot!


Return to posts index

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