How to use custom method to get tag tree browser selected field value?

i am getting this error when i use this 3 lines this is the issue i am facing past one week . please give any alternative solution

my script