Using praat executable, I can write TextGrid Interval in a text file by clicking on To TextGrid (vuv) button in the right panel in the following image. I’m using To TextGrid (vuv)... 0.02 0.01 code to in the praat script but getting “Command To TextGrid (vuv)..." not available for current selection error.
Am I missing something?
Can It be possible to do so using praat script at all?

This may help.
In addition, you can join praat-users group on Yahoo where Paul – one of the authors of Praat is very active answering questions. You can learn more about praat scripting on the praat manual here.
http://www.fon.hum.uva.nl/praat/manual/Scripting.html