Dump Screen
Gets the text displayed on the terminal screen.
Command availability: IBM RPA SaaS and IBM RPA on premises
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
terminalDumpScreen [--concatenate(Boolean)] [--dumptofile(Boolean)] [--savedirectory(String)] [--filename(String)] [--columnbreak(Numeric)] (String)=value
Dependencies
Use one of the following commands to connect to a Terminal:
- Connect to Terminal (
terminalConnect
) - Connect to Terminal via Telnet (
terminalTelnetConnect
) - Connect to Terminal via SSH (
terminalSshConnect
)
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Concatenate Text | concatenate |
Optional |
Boolean |
Concatenates text taken from the terminal screen with the output variable. |
Send to File | dumptofile |
Optional |
Boolean |
Sends text taken from the terminal screen to a ".pdf" file. |
Directory | savedirectory |
Optional |
Text |
Path to create or overwrite the ".pdf" file on. |
File Name | filename |
Optional |
Text |
File name for the ".pdf" file. |
Line Break | columnbreak |
Optional |
Number |
Breaks the line when the amount of characters defined here is reached. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Obtained Text | value | Text |
Text taken from the terminal screen. |
Example
Example 1: You get the active screen text of a terminal, with the desired amount of line breaks, saving the obtained text in a variable.
defVar --name hostname --type String --value "example.com"
defVar --name obtainedText --type String
defVar --name terminalConnection --type Boolean
defVar --name validateScreen --type Boolean
// Connecting to the terminal.
terminalConnect --name terminal --hostname "example.com" --port 23 --timeout 00:01:00 terminalConnection=value
terminalValidateScreen --keywords "${hostname}" --label example validateScreen=value
// Here the text is obtained with 21 characters for each line break.
terminalDumpScreen --concatenate--columnbreak 21 obtainedText=value
logMessage --message "${obtainedText}" --type "Info"
terminalDisconnect --name terminal
// The above example displays the text obtained from the terminal screen.
Example 2: You get the active screen text of a terminal with the desired number of line breaks, saving the text obtained in a variable and a ".pdf" file in a specified folder.
defVar --name hostname --type String --value "example.com"
defVar --name validateScreen --type Boolean
defVar --name obtainedText --type String
defVar --name fileName --type String --value DumpScreen
defVar --name terminalConnection --type Boolean
defVar --name documentsPath --type String
getSpecialFolder --folder "MyDocuments" documentsPath=value
// Connecting to the terminal.
terminalConnect --name terminal --hostname "example.com" --port 23 --timeout 00:01:00 terminalConnection=value
terminalValidateScreen --keywords "${hostname}" --label example validateScreen=value
// Here the text is taken with 20 characters for each line break and stored in the variable "obtainedText".
terminalDumpScreen --concatenate--dumptofile--savedirectory "${documentsPath}" --filename "${fileName}" --columnbreak 20 obtainedText=value
logMessage --message "${obtainedText}" --type "Info"
terminalDisconnect --name terminal
// The above example displays the text stored in the "obtainedText" variable and generates a PDF file.