Detect number of lines in dynamic textfield

I’ve been trying to detect the number of lines used in a dynamic textfield without any luck. I have tried using the scroll property of a field which didn’t work (Find my attempt attached) Does anyone have any suggestions?

Thanks.