Copied!
May 25, 2020
After-Effects expression
Get the number of layers in this comp
When applied to a text layer's "source text" property, it will return the amount of layers in the current comp.
Text Layer

Source Text
Expression
thisComp.numLayers;