Terminal - Get text

Declaration

<AMTERMINAL ACTIVITY="gettext" SESSION="Text" RESULTVARIABLE="text" ACTION="text (options)" 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 Connect Terminal 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

  1. ACTION="currentline"

  2. ACTION="entirescreen"

  3. ACTION="specificline"

  4. 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.

Line

Number

Yes if Text to Get parameter 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  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 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  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  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.

Place Buffer into Variable

Text

Yes

(Empty)

RESULTVARIABLE="Var1"

The name of the variable in which to place the retrieved text.

Session Name

Text

No

TermSess1

SESSION="TermSess2"

The session name from which to get the text. This session name must have been previously created with a Connect Terminal 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.

 

Description

Error Causes

On Error

 Example

NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description

Get the contents of line 3 on terminal "mySession" and place into the variable "var1".

 

<AMGETTERMTEXT SESSION="mySession" RESULTVARIABLE="var1" ACTION="LINE" LINE="3" />