<< Click to Display Table of Contents >>

Navigation:  Reference (Scripting) > Docklight Script Commands - The DL Object > Methods (Advanced) >


Create an additional user output tab in the documentation/script area of the Docklight main window. Add plain text or formatted RTF output to provide visual user feedback and/or menu-style interaction (using GetKeyState).




DL.SetUserOutput text [, rtfFormat] [, append] [, readFromFile]


The SetUserOutput method syntax has these parts:





Required. Your output to show or add.


If text is an empty string, the output tab is removed again from the Docklight main window .


Optional Boolean value.

False (Default) = text is plain text

True = text is a valid RTF document, e.g. the contents of a RTF document file.


Optional Boolean value.

True (Default) = add text to the already existing content.

False = replace the existing output content with text .


Optional Boolean value.

False (Default) = text contains the actual text or RTF document

True = text is a file and its contents should be displayed.

NOTE: if a file does not exist or cannot be loaded, SetUserOutput uses an empty string instead and does not indicate an error.




SetUserOutput can help you to create a customized user output or offer menu-style user interactions. An example could be choosing from different predefined tests in an automated device testing rig.


See the SetUserOutput_Example.pts example script in the ScriptSamples\Extras\SetUserOutput_Example folder for the different possibilities of loading / adding formatted text.




DL.SetUserOutput "" ' clear output

DL.Pause 1000 

DL.SetUserOutput "A good old 'Hello World!'"

DL.Pause 5000

DL.SetUserOutput "... more text ..."

DL.Pause 5000


' You can create your RTF document bits with Windows Wordpad and 

' open the resulting .rtf file with Windows Notepad to see the RTF code.

rtfExample = "{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Harlow Solid Italic;}}{\colortbl ;\red75\green172\blue198;}\cf1\f0\fs32 A Curly Hello!\par}"

DL.SetUserOutput "... something more colorful ..."

DL.SetUserOutput rtfExample, True


DL.Pause 5000

DL.SetUserOutput "The End. Removing output tab soon...", False, False

DL.Pause 5000

DL.SetUserOutput ""



Example 2 (read RTF file and display)


DL.SetUserOutput "C:\mytext.rtf", True, False, True