Condition if "text is show" then

The code that has been suggested to me does not work and, instead it has compilations errors.
Does anyone else have suggestions for how to fix or correct my initial code?

Thanks in advance as always