It's fairly simple actually.
I assume you've seen the [[LavishGUI:lguiconsole_(Data_Type)|lguiconsole datatype wiki page]], but there's the link anyway to help follow along. If not, then let me quickly mention that there's 2 wiki pages for each type of element -- one for the XML and behavior information, and one for the LavishScript object information.
So, from this we see that the lguiconsole datatype has an Echo method, so once we get access to the lguiconsole object, then all we do is obj:Echo["Stuff to echo!"]
This means the question is now, how do we access the lguiconsole object for a console element we've loaded. We start at the [[LavishGUI:Top-Level Objects]] page (from the main [[LavishGUI]] page), and specifically to the [[LavishGUI:UIElement (Top-Level Object)|UIElement TLO]], which may be ever so slightly misleading as it says it returns lguielement, whereas it actually returns whatever type of element is being accessed. This TLO is best used with the desired UI element's [[LavishGUI:Elements#Notes_on_Element_Names|Fully-Qualified Name]].
The element's Fully-Qualified Name (FQN) is made up of the element name and each of its parents' names (from this element to its outermost parent), separated by the @ character. For example, if an element named "Output" resides in a top-level element named "Console", the element's FQN is "Output@Console".
The example FQN is exactly that of the main console used in the uplink or any session. So, let's put this all together for a test:
Code: Select all
UIElement[Output@Console]:Echo["Hello World!"]
And voila! The text is output directly to the "Output@Console" console element.
So now all you need to do is successfully relay it. I would use an atom rather than relaying the sequence, so something like..
Code: Select all
atom(global) myecho(string output)
{
UIElement[Output@Console]:Echo["${output.Escape}"]
}
Then just make sure that the parameter to myecho is quoted since this is expecting 1 parameter rather than any number, as echo takes. It can of course be done but it's easiest just to quote the parameter in this case.