How to get meshes names by clicking?

Thanks a lotttttt, It worked for me