No problem, happens to me all the time.
So first, a brief explanation of how arguments work. A lisp file is put together like this:
(defun FunctionName (Arguments / Local Variables)
(Things to do)
)
In basic programs, you may be used to running the program, having it ask you for input, then performing some tasks. For example, you run a program called "MakeLayer" and it asks you to "Enter the Name", then "Specify a color", then makes a layer. But, sometimes you want the input to come programmatically. In this case, the input is called an "argument" and is listed before the "/" above. Within the code, the arguments act like variables that are already set. For example, the MakeLayer function might look like:
(defun MakeLayer (name color / )
(if (and (= (type name) 'STR)
(= (type color) 'INT)
)
(entmake (list '(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
(cons 2 name)
'(70 . 0)
(cons 62 color)
)
)
(princ "\nName must be a string and color must be an integer!")
)
(princ)
)
"name" and "color" are the arguments to the function and have to be included when you call the function. So if you wanted to make a layer that's a certain color you could type (MakeLayer "Steel" 2) at the command line (or in a button). This would make a layer called "Steel" thats color 2. Notice how I called the function. First there's the "(MakeLayer" part. That's obviously the function name. Then after that is "Steel". This is the first argument, and is assigned "name" in the program. The next part is "2" (but without quotes). That's the second argument and is assigned "color" in the program.
What you want to do is modify the mt2ml function to take an argument (that is the mtext object returned by Ron's function) instead of prompting the user for it. So if you examine the mt2ml function, you will see this line:
(setq oobj (vlax-ename->vla-object (car (nentsel "\nSelect source text: "))))
This is where the original program is asking the user to select the source text, then converts it to a vla object, and assigns it to a variable called "oobj". So the simplest thing to do is to make the first argument be called "oobj", and remove the (setq oobj (vlax... blah blah blah) line. In other words, you don't need to setq the oobj variable in the code, because you are passing the oobj to the code from the arguments. So add an argument called oobj and comment out the setq line. I'm going to let you try it first and report back if it doesn't work. It's always more satisfying that way.