-
Expression for adding an explanation point to a text layer
I am needing to know how to add some form of punctuation to the end of a text layer when a certain number is reached. For example I have a counter expression (see below) and when it reaches something like ten I want to add in the punctuation to the end of the text layer. The text will be based upon the counter created with a slider control. I have tried this only to get some error message. I assume that the expression considers the expression itself as some type of equation resulting in the error message.
I want to keep the layers to a minimum if possible. I did find that if I made two text layers that I could accomplish my goal without getting an error message. The first text layer did have the source text linked to a slider control that does the counting. The second text layer had its source text linked to first text layer. There it was possible to use the expression I wanted. I could be missing something simple here and might be making things more complicated than they need to be.
Thank you for having this forum!
Name of the text layer is subscription counter
The expression slider control is counterExpression for slider control:
Math.abs(effect("Counter")("Slider")) // This is the counter
Math.abs(effect("Goal")("Slider")) // This is the goalExpression for source text:
text = effect("Counter")("Slider");
goal = effect("Goal")("Slider");
if (text == goal)
{ [ text+"!"] }
else
{ [ text ] }Using the above expression I get an error message that says, "Divide by zero?"