Script function names are not case sensitive. Empty lines can be used. Comment lines must start with a # in the first position. The script file will terminate if an error has occurred. The line number where it was detected will be displayed on the status line. If the script terminates normally the text Script file closed will be displayed on the status line. The upper left corner of the view has the row and column value 1. | |
Name | Description |
---|---|
TypeString | It will type the string parameter into the screen, starting from the current cursor position. If the current input field length is less than the string length, the rest of the string will continue in the next input field. Script parameters from the command line can also be used. TypeString ("This is a text string") or TypeString ("$SP3") |
FunctionKey | It will type a function key at current cursor position. Function key names available: ENTER, TAB, BACKTAB, HOME, UP, DOWN, LEFT, RIGHT, DELETE, NEWLINE, BACKSPACE, ERASETOEOF, ERASEFIELD, ERASEINPUT, ATTENTION, SYSREQ, CLEAR, INSERT, DUP, FMARK, RESET, PA1, PA2, PA3, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PF16, PF17, PF18, PF19, PF20, PF21, PF22, PF23, PF24, HELP, FIELDEXIT, ROLLUP or ROLLDOWN. FunctionKey (CLEAR) |
TypeInput | It will popup an input dialog box with an information text according to the string parameter. The user input from the dialog box will be handled by the TypeString function. TypeInput ("Please type your password") |
WaitFor | It will suspend the script until the event parameter has occurred. Events available: CONNECT (No wait if connected, else wait until connected), UNLOCK (Keyboard reset/unlock by host system), SECURE_CONNECTION (Wait until the secure connection (SSH/SSL) has been established), KEYBOARD (Any keyboard input). WaitFor (UNLOCK) |
WaitForText | It will suspend the script until the text string parameter has been found somewhere on the screen. The text is case sensitive. WaitForText ("User name:") |
WaitForTimer | It will suspend the script for some milliseconds. If no system timer is available this function will terminate the script. WaitForTimer (3500) |
SetCancelTimer | It can be used to set a timer to stop a script, which is in some wait state. The parameter is the number of milli seconds until it will close the script. The script will continue with the next script function after it has been set. SetCancelTimer (60000) |
WaitForCursorPos | It will suspend the script until the cursor is in an exact screen position. The first parameter is the row position and the second parameter is the column position. The first screen position is row 1 and column 1. WaitForCursorPos (20, 34) |
WaitForItemsCursorPos | It will suspend the script until the cursor is in an exact screen position. The first parameter is a number item for the row position and the second parameter is a number item for the column position. The first screen position is row 1 and column 1. WaitForItemsCursorPos (RITEM, CITEM) |
NoUserInput | It will return TRUE if no input has been provided from TypeInput. Can be used with the script if test. NoUserInput () |
TypeHiddenInput | It will popup an input dialog box with an input field for password input. The user input from the dialog box will be handled by the TypeString function. TypeHiddenInput ("Please type your password") |
GetNewPassword | It will popup an input dialog box with three input fields for password input. One for the current password and two for the new password (one is for confirmation). The current password and the new password will be stored in the fixed string variables CURRENT_PWD and NEW_PWD. The string variables can be used with script function TypeStringItem, like TypeStringItem (NEW_PWD). GetNewPassword () |
OpenSession | It will open and replace current session with the new session, if the current session is connected it will be disconnected. All session setup parameters will be replaced. The script file will continue with the next script function. OpenSession ("host.nmt") |
LoadSession | It will load and replace current session with the new session, if the current session is connected it will be disconnected. All session setup parameters will be replaced. The script file will continue with the next script function, but the connection will not be opened. The next function could be ConnectHost. LoadSession ("host.nmt") |
SaveSession | It will save current session setup to a new session file or the current session file name. SaveSession ("host.nmt") or SaveSession () |
TerminateInstance | Disconnect (if connected) and close current terminal instance. TerminateInstance () |
OpenPrintSession | A new instance of NMP will be started with the print session file as command line parameter. OpenPrintSession ("hprint.nmp") |
ConnectHost | It will disconnect current connection and start a new connection. Host name as parameter. No other session setup parameters will be changed. ConnectHost ("main.frame.com") |
StartScript | Close current script at this position and start a new script. Default script file type is SRL (Script Recording Language). StartScript ("cics.srl") |
StartApplication | It will start a Windows Application. Include any parameters to the application after the application name. The script will terminate if the application has not been started successfully. StartApplication ("NOTEPAD hostcap.txt") or StartApplication (""C:\Program Files\nmt\nmt.exe" "C:\Program Files\nmt\tso.nmt""). Notice the double exclamation marks. Or just StartApplication (""C:\Program Files\nmt\tso.nmt"") |
SetModelType | Set model type. No connection must have been established. SetModelType (3) |
SetExtendedMode | Set extended mode, TRUE or FALSE. No connection must have been established. SetExtendedMode (TRUE) |
SetTelnetPort | Set telnet port. No connection must have been established. SetTelnetPort (1023) |
SetLuName | Set LU name. No connection must have been established. SetLuName ("XYZNN") |
SetAnswerback | Set answer back text for the current session. It must be called just after the OpenSession function or to configure a new session. SetAnswerback ("nexus") |
Disconnect | Disconnect current session if connected. No session setup parameters will be changed. Disconnect () |
IsConnected | Returns TRUE or FALSE. IsConnected () |
StartCapture | Open a file for screen image capture. StartCapture ("hcap.txt") |
StopCapture | Disable and close current capture file. StopCapture () |
SetAutoCapture | Enable or disable auto capture on attention keys - TRUE or FALSE. SetAutoCapture (TRUE) |
ReceiveHostFile | Transfer host file to PC in ascii CR LF mode. Two parameters: Local file name and host file name. ReceiveHostFile ("C:\temp\info.txt", "hostfn") |
ReceiveBinHostFile | Transfer host file to PC in binary mode. Two parameters: Local file name and host file name. ReceiveBinHostFile ("C:\temp\info.txt", "hostfn") |
SendLocalFile | Transfer local file to host in ascii CR LF mode. Two parameters: Local file name and host file name. SendLocalFile ("C:\temp\info.txt", "hostfn") |
SendBinLocalFile | Transfer local file to host in binary mode. Two parameters: Local file name and host file name. SendBinLocalFile ("C:\temp\info.txt", "hostfn") |
CaptureImage | Capture current screen image to file or scroll back buffer. If the file has not been opened, a file open dialog box will be opened. CaptureImage () |
TextInImage | Test if a text sequence is in the current screen image. It can be used with the While/EndDo / If/EndIf block. TextInImage ("MORE INFO") |
NoTextInImage | Test if a text sequence is NOT in the current screen image. It can be used with the While/EndDo / If/EndIf block. NoTextInImage ("END OF DATA") |
StringItemInImage | Test if a string item is in the current screen image. It can be used with the While/EndDo / If/EndIf block. StringItemInImage (SITEM) |
PopUpMsg | Display a popup message. PopUpMsg ("Remember to ... .. .") or PopUpMsg (TITEM) |
MsgBeep | A short beep message. MsgBeep () |
StatusLineText | Put a short text on the status line. StatusLineText ("Wait for input") |
Minimize | Minimize window into an icon. Minimize () |
Restore | Restore window size and position. Restore () |
SttyErase_Backspace | Send/type "stty erase BS". SttyErase_Backspace () |
SttyErase_Delete | Send/type "stty erase DEL". SttyErase_Delete () |
SttyRows | Send/type "stty number of rows". SttyRows () |
SetLabel | Set a script label, which can be used by the GoToLabel script function. SetLabel ("GOTO_ABC") |
GoToLabel | Jump or go to a script label. A "go to label" must be defined within the end of the script file. GoToLabel ("GOTO_ABC") |
SetPrintBuffer | Set the number of print images (1 | 2 | 3). It can be used to print one, two or three images on one page. SetPrintBuffer (3) |
PrintTextFile | Print a text file. It will be formatted according to the print setup. PrintTextFile ("Output.txt") |
PrintDataFile | Print a text/data file. It will be sent directly to the printer. PrintDataFile ("Output.txt") |
OpenPrintFile | Open a file, which screen images will be written to on "Print Screen". OpenPrintFile ("Output.txt") |
ClosePrintFile | Close an opened print file. OpenPrintFile () |
PrintImage | Print current screen images to a printer or to a file (if a print file has been opened). PrintImage () |
SetLinesPerPage | Set number of lines on each page printed. SetLinesPerPage (72) |
SetPrintFontHeight | Set print font height. SetPrintFontHeight (188) |
TypeHexString | Type a byte sequence, which is set as a hexadecimal sequence. TypeHexString ("1B4F50") |
SendHexString | Send a byte sequence (directly), which is set as a hexadecimal sequence. SendHexString ("1B4F50") |
SendString | Will send the string directly to the connected server without any local emulation SendString ("Text string") |
DefaultPrinter | Set default printer (TRUE). If FALSE, then each print job will open the Printer Dialog. DefaultPrinter (FALSE) |
NumberItem | Allocate a number variable. It will be set to zero if no extra parameters are added. NumberItem (NCOUNT) or NumberItem (NCOUNT, 10) |
StringItem | Allocate a string or text variable. It will be set empty if no extra parameters are added. StringItem (SITEM) or StringItem (SITEM, "END OF PAGE") |
SetNumberItem | Set a new value for allocated number variable. SetNumberItem (NCOUNT, 100) |
SetStringItem | Set a new text value for a allocated string variable. The first parameter is the destination and the second parameter the source. SetStringItem (SITEM, "END OF PAGE") |
CopyStringItem | Copy the content of the second string item into the first string item. CopyStringItem (SITEM, TITEM) or CopyStringItem (SITEM, TEXT_ITEM) |
AppendStringItem | Append the content of the second string after the first string item. AppendStringItem (SITEM, TITEM) or AppendStringItem (SITEM, TEXT_ITEM) |
TrimItemSpace | Clears all leading and termination spaces. TrimItemSpace (SITEM) |
TrimItemLeft | Clears all leading space characters. TrimItemLeft (SITEM) |
TrimItemRight | Clears all termination space characters. TrimItemRight (SITEM) |
GetItemLength | Copy the string item length of the second parameter into the number value of the first parameter. GetItemLength (NCOUNT, SITEM) |
CopyNumberItem | Copy the content of the second number item into the first number item. CopyNumberItem (NCOUNT, ROW) |
IncNumberItem | Increment the value for a allocated number varaible with 1. IncNumberItem (NCOUNT) |
DecNumberItem | Decrement the value for a allocated number varaible with 1. DecNumberItem (NCOUNT) |
NumberItemLessThan | True if the allocated number varaible is less than the second parameter provided. NumberItemLessThan (NCOUNT, 50) or NumberItemLessThan (NCOUNT, ROW) |
NumberItemGreaterThan | True if the allocated number varaible is greater than the second parameter provided. NumberItemGreaterThan (NCOUNT, 10) or NumberItemGreaterThan (NCOUNT, ROW) |
NumberItemEqualTo | True if the allocated number varaible is equal to the second parameter provided. NumberItemEqualTo (NCOUNT, 30) or NumberItemEqualTo (NCOUNT, ROW) |
CopyImageToClipboard | Copy text (from row/column and number of bytes) to the clipboard. CopyImageToClipboard (10, 12, 16) or CopyImageToClipboard (RNO, CNO, NCOUNT) |
PasteFromClipboard | Type the text from the clipboard. PasteFromClipboard () |
TypeStringItem | Type the string variable value into the current image cursor position. TypeStringItem (SITEM) |
TypeVariable | Can be used to type both string and number variables. TypeVariable (SITEM) or TypeVariable (NCOUNT) |
StringItemContainsText | True if the string variable value contains the text. StringItemContainsText (SITEM, "abc") |
StringItemSwapText | Swap some part (the second parameter) of the string variable value with an other string text (the last parameter). StringItemSwapText (SITEM, "abc", "xyz") |
CopyImagetoStringItem | Set the allocated string variable value to the content of the current image row, column and length. First image row and column is 1. CopyImageToStringItem (SITEM, 10, 16, 12) or CopyImageToStringItem (SITEM, RITEM, CITEM, LITEM) |
StringItemsEqual | True if the two string variables are equal. StringItemsEqual (SITEM, TITEM) |
StringItemsNotEqual | True if the two string variables are not equal. StringItemsNotEqual (SITEM, TITEM) |
StringItemEqualText | True if the string variable is equal to the text parameter. StringItemEqualText (SITEM, "PRESS ENTER") |
StringItemNotEqualText | True if the string variable is not equal to the text parameter. StringItemNotEqualText (SITEM, "PRESS ENTER") |
SetFileTransferAppend | Select append mode file transfer (TRUE/FALSE). If TRUE, then each new file transfer will append to an existing file. SetFileTransferAppend (FALSE) |
SetReceiveParameters | Set extra receive file parameters, which will be appended to the default parameters. SetReceiveParameters ("abc") |
ResetReceiveParameters | Clear the extra receive file parameters. ResetReceiveParameters () |
SetSendParameters | Set extra send file parameters, which will be appended to the default parameters. SetSendParameters ("abc") |
ResetSendParameters | Clear the extra send file parameters. ResetSendParameters () |
FileExist | Test/check if a file exist. It returns TRUE or FALSE and can be used with the IF test. FileExist ("C:\temp\abc.txt") |
RemoveFile | Remove a file if it exist. RemoveFile ("C:\temp\abc.txt") |
CopyImageToClipboard | Copy a subset of the image to the Clipboard. Three parameters, row, column and number of bytes. First row and column start at position 1. CopyImageToClipboard (12, 48, 16) |
LoadEbcdicTable | Load a new EBCDIC to ANSI/ASCII translation table (256 bytes). The new table must be loaded after the session has been loaded. Table index n is the ANSI/ASCII value of the corresponding EBCDIC character. LoadEbcdicTable ("C:\NMT\NewE_UK.tbl") |
StartOpenSSL | Start OpenSSL manually. It is used to start SSL after a successful connection through a proxy. The accelerator keys Alt+Shift+S can also be used. StartOpenSSL () |
OpenTextFile | Open a text file for parsing with ReadTextLine and GetNextItem. OpenTextFile ("C:\temp\abc.txt") |
CloseTextFile | Close the opened text file. It will also be closed when the script terminates. CloseTextFile () |
ReadTextLine | Read a line from the opened text file into the fixed variable TEXT_LINE. It can later be used with the script function TypeStringItem (TEXT_LINE). It returns FALSE at end of file.ReadTextLine () |
GetNextItem | Gets the next text item from the fixed variable TEXT_LINE. The text string will be stored in the fixed variable TEXT_ITEM. It can later be used with the script function TypeStringItem (TEXT_ITEM). The default text separator is ",\t\n", but it can be changed with the script function SetTextToken. It returns FALSE at end of line.GetNextItem () |
SetTextToken | Set the text item separator for the GetNextItem function. SetTextToken (" ;\t") |
AcceptEmptyItems | GetNextItem will default not return empty items, but if AcceptEmptyItems is called with the parameter TRUE, then also empty items will be returned. AcceptEmptyItems (TRUE) |
IsStringItemEmpty | It can be used to test if a string variable is empty. IsStringItemEmpty (TEXT_ITEM) |
IsStringItemNotEmpty | It can be used to test if a string variable is not empty. IsStringItemNotEmpty (SITEM) |
WaitForString | Stop the script execution until the string variable is detected in the screen image. It can be used after a TypeStringItem to verify that is has been sent and received by the remote server (vt/ansi echo mode). WaitForString (SITEM) |
SetCursorPos | Set cursor position for a 3270 or 5250 terminal session. The first parameter is row and the second is column. Upper left corner is row 1 and column 1. SetCursorPos (12, 52) |
SetRowColumn | Set cursor position for a 3270 or 5250 terminal session. The first parameter is a number item for the row and the second is a number item for the column. Upper left corner is row 1 and column 1. SetCursorPos (RITEM, CITEM) |
GetCursorPos | Copy the current cursor position into two number items. The first parameter is for the row and the second for the column. Set cursor position for a 3270 or 5250 terminal session. The first parameter is a number item for the row and the second is a number item for the column. GetCursorPos (RITEM, CITEM) |
GetViewSize | Copy the current terminal view size into two number items. The parameter is for the row and the second for the column. Set cursor position for a 3270 or 5250 terminal session. The first parameter is a number item for the row and the second is a number item for the column. GetViewSize (RITEM, CITEM) |
OpenOutputFile | Open a text file for writing. Up to ten files can be opened at the same time. The first parameter is the file id (0|1|2|3|4|5|6|7|8|9) and the next parameter is the file name to be opened. If the file exist, then the output will be appended, else it will create a new file. OpenOutputFile (0, "C:\temp\abc.log") |
CloseOutputFile | Closed an opened file. The file id (0|1|2|3|4|5|6|7|8|9) is the only needed parameter. CloseOutputFile (0) |
WriteItemToFile | Write a text or number variable/item to an opened file. The first parameter is the file id and the next parameter is the string or number item. WriteItemToFile (0, TEXT_ITEM) |
WriteStringToFile | Write a text string to an opened file. The first parameter is the file id and the next parameter is the string. Both WriteItemToFile and WriteStringToFile will remove leading and terminating spaces. WriteStringToFile (0, "Have a nice day") |
AppendNewLineToFile | Write a new line to an opened file. The only parameter needed is the file id. AppendNewLineToFile (0) |
AppendTabToFile | Write a tab character to an opened file. The only parameter needed is the file id. AppendTabToFile (0) |
FlushOutputFile | Flush an opened file. The only parameter needed is the file id. FlushOutputFile (0) |
AppendTsToFile | Append a time stamp to an opened file. The only parameter needed is the file id. AppendTsToFile (0) |
SetCloseOnDisconnect | Set close on disconnect (TRUE/FALSE). SetCloseOnDisconnect (FALSE) |
SetShortId | Set short HLLAPI id (a single character). SetShortId ("A") |
SetLongId | Set long HLLAPI id (max 8 characters). SetLongId ("Nexus") |
ClearImage | Clear the screen image for a vt/ansi session. The cursor will be moved to the first position (1/1). ClearImage () |
SetTsFormat | Set time stamp format. The formatting codes are listed below: %a Abbreviated weekday name %A Full weekday name %b Abbreviated month name %B Full month name %c Date and time representation appropriate for locale %d Day of month as decimal number (01 - 31) %H Hour in 24-hour format (00 - 23) %I Hour in 12-hour format (01 - 12) %j Day of year as decimal number (001 - 366) %m Month as decimal number (01 - 12) %M Minute as decimal number (00 - 59) %p Current locale’s A.M./P.M. indicator for 12-hour clock %S Second as decimal number (00 - 59) %U Week of year as decimal number, with Sunday as first day of week (00 - 53) %w Weekday as decimal number (0 - 6; Sunday is 0) %W Week of year as decimal number, with Monday as first day of week (00 - 53) %x Date representation for current locale %X Time representation for current locale %y Year without century, as decimal number (00 - 99) %Y Year with century, as decimal number %z Time-zone name %Z Time-zone name abbreviation %% Percent sign The # flag may prefix any formatting code. In that case, the meaning of the format code is changed as follows. %#a, %#A, %#b, %#B, %#p, %#X, %#z, %#Z, %#% # flag is ignored. %#c Long date and time representation, appropriate for current locale. For example: Tuesday, March 14, 1995, 12:41:29. %#c Long date and time representation, appropriate for current locale. For example: Tuesday, March 14, 1995, 12:41:29. %#x Long date representation, appropriate to current locale. For example: Tuesday, March 14, 1995. %#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y Remove leading zeros (if any). SetTsFormat ("%B %d, %Y %H:%M:%S") |
KermitDownload | Download a remote file with the Kermit protocol. Remote file name as parameter. KermitDownload ("xyz.txt") |
KermitUpload | Upload a local file with the Kermit protocol to the remote server. Local file name as parameter. KermitUpload ("C:\temp\abc.txt") |
PopUpEncString | Encrypted the input text and popup the result in a message box. PopUpEncString ("password") |
TypeEncString | Will decrypt the hexadecimal input text and send it to the connected host. TypeEncString ("CAC4CFDBE9C374") |
A simple logon script. | |
While/If-blocks can be nested. And several If-blocks can be used in a
While-block and several While-blocks can be used in an If-block. |
|
SetLabel and GoToLabel can be used to build while-loops within an other while loop like: |
|
An other example: |
|
# This script reads the screen image, one character at the time and writes it to a file. |
|
One single script file can start several nexus session (and other tasks): |