Adobe After Effects Expressions Forum
Using charAt on Expression Selector on Arabic (RTL) Text
Using charAt on Expression Selector on Arabic (RTL) Text
by Fabio Basone on Apr 27, 2020 at 1:23:16 pm

Hello

I'm developing a Mogrt template which i need to function in both Latin and Middle East & South Asian Languages.

The template is fairly complex (for me, anyway!) but basically, I've created an input text field that automatically splits the text into separate text layers.
It also allows the user to highlight specific words by adding a special character (^) before the word to be highlighted. This works through an expression added to an Expression selector for 'highlight colour'.




This is working well in the Latin (left to right) text version but when i try and build a similar function for an Arabic version the expression doesn't work as expected. The highlight doesn't appear on the word where i've added the "^" - it appears 2 words to the right of this word.

Text Engine in Preferences are correct and the Arabic text otherwise appears correctly.

Does anyone know how i can adjust the expression so that the word with the "^" character next to it, is highlighted?

Hopefully, this makes sense and many thanks

Fabio

words = thisComp.layer("CtrlText").text.sourceText.split("\r")[0].split(" ");
currentWord = words[textIndex-1];
if(currentWord.charAt(0)=="^"){color=100}
else{color = 0};
[color,color,color];






© CreativeCOW.net