Terminal - Get text

Declaration

<AMTERMINAL ACTIVITY="gettext" SESSION="TerminalSession1d" RESULTVARIABLE="ddd" ACTION="text (options)" LINE="text" BEGINROW="number" BEGINCOL="number" ENDROW="number" ENDCOL="number" />

Related Topics    

Description

Retrieves text from the terminal during an established terminal session and populates a variable with the results. This action can be set to retrieve text from the entire screen, the current line, a specified line, or a specified range.

Practical usage

Generally used to get text from an existing terminal session that was previously created by a Terminal - Connect step. The terminal actions are used in lieu of terminal emulation software. With the use of the terminal actions, legacy systems can be automated in the background without the use of 3rd party software.

Parameters

General

Property Type Required Default Markup Description
Text to get Text (options) No Entire screen
  • ACTION="currentline"
  • ACTION="entirescreen"
  • ACTION="specificline"
  • ACTION="range"
The location from which to retrieve the text. The available options are:
  • Current line - Retrieves the line of text from the current cursor position.
  • Entire screen (default) - Retrieves text from the full displayed screen.
  • Specific line - Retrieves text from the specified line.
  • Range - Retrieves a range specified by Beginning row, Beginning column, Ending row, and Ending column parameters.
Place buffer into variable Text Yes (Empty) RESULTVARIABLE="Var1" The name of the variable in which to place the retrieved text.
Session Text No TerminalSession1 SESSION="TermSess2" The session name from which to get the text. This session name must have been previously created with a Terminal - Connect step. This allows several connections to be active simultaneously. If you are only using one connection at a time, do not specify a value other than the default.
Line Number Yes, if Text to get is set to Specific line (Empty) LINE="4" The line number to retrieve text from. This parameter is available only if the Text to get parameter is set to Specific line.
Beginning row Number Yes, if Text to get is set to Range (Empty) BEGINROW="11" The beginning row of the range of text to get. This parameter is available only if the Text to get parameter is set to Range.
Beginning column Number Yes, if Text to get is set to Range (Empty) BEGINCOL="3" The beginning (left) column of the range of text to get. This parameter is available only if the Text to get parameter is set to Range.
Ending row Number Yes, if Text to get is set to Range (Empty) ENDROW="24" The ending row of the range. This parameter is available only if the Text to get parameter is set to Range.
Ending column Number Yes, if Text to get is set to Range (Empty) ENDCOL="20" The ending (right) column of the range. This parameter is available only if the Text to get parameter is set to Range.

Description

Error Causes

On Error

 Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This sample task gets the contents of line 3 on terminal "mySession" and places it into the variable "var1."

Copy
<AMTERMINAL ACTIVITY="gettext" SESSION="mySession" RESULTVARIABLE="var1" ACTION="line" LINE="3" />