<< Click to Display Table of Contents >> Navigation: Reference (Scripting) > Docklight Script Commands - The DL Object > Methods (Advanced) > SetUserOutput |
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).
Syntax
DL.SetUserOutput text [, rtfFormat] [, append] [, readFromFile]
The SetUserOutput method syntax has these parts:
Part |
Description |
text |
Required. Your output to show or add.
If text is an empty string, the output tab is removed again from the Docklight main window . |
rtfFormat |
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. |
append |
Optional Boolean value. True (Default) = add text to the already existing content. False = replace the existing output content with text . |
readFromFile |
Optional Boolean value. False (Default) = text contains the actual text or RTF document True = text is a file and its contents should be displayed. |
Remarks
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.
Example
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