2 Replies Latest reply on Jun 3, 2015 9:19 AM by enriqueskillfilms

    Expression to select and affect specific characters in a text

    enriqueskillfilms

      Hi there,

       

      I am trying to create an expression in a text layer so that a specific character is found in the text, like this bullet point: • (alt+8), a different colour is applied.

       

      At Creative Cow the always helpful Dan Ebberts kindly suggested the following:

       

      Add a Fill Color Animator and set the color for the special character.

       

      Add an Expression Selector.

       

      Delete the Range Selector.

       

      Replace the Amount expression in the Expression Selector with this:

       

      myChar = "•";

      if (text.sourceText[textIndex-1] == myChar) 100 else 0

       

      This works with one line but then a different problem arises: for some reason it selects the correct character on the first line but then selects and modifies the colour of the second character on the second line, the third character on the third line, and so on. Understand that of course the bullet point is always the first character on each line.

       

      Any ideas?

       

      Thanks!