While trying to figure out different ways to do things I used to do with lisp, I found this out.
Use DIESEL in your commands. Tool palette, menus or toolbars it will work in all. I created this one to automatically set text height per dimscale.
I hope this will help,