appendtext('gedit','txtmain','Sample text')
This to append 'Sample text' to the 'main' text box contents in gedit