Translate page

Script Examples

Script Examples

The following are three short example scripts. The blank lines have been added for clarity only, they have no effect on the script. For more information on the individual commands, please check the List of Supported Commands section.

 

Example 1:

 

REM ------------------------ BEGINNING OF SCRIPT ------------------------

REM

REM ALL EXAMPLES IN THIS FILE COULD HAVE BEEN TYPED

REM IN UPPERCASE AS WELL, EXCEPT FOR THE PARTS THAT

REM APPLY TO SEARCH TEXT (THIS TEXT IS CASE SENSITIVE)

REM

port 2445

REM The following address is not valid

connect ‘‘111.11.111.11’‘

lookfor ‘‘SPARTACUS KNET/MVS’‘

cursor ‘‘1/14

type ‘‘tso’‘

key ‘‘enter’‘

REM Change the delimiter from ‘‘ to *

delimiter *

key *enter*

REM And change it back to the default

delimiter ‘‘

lookfor ‘‘PLEASE ENTER USERID’‘

prompt ‘‘Please enter your user id’‘

key ‘‘enter’‘

lookfor ‘‘Enter LOGON parameters’‘

password ‘‘Enter your password’‘

key ‘‘enter’‘

lookfor ‘‘***’‘

key ‘‘enter’‘

lookfor ‘‘Welcome to’‘

key ‘‘enter’‘

lookfor ‘‘***’‘

key ‘‘enter’‘

lookfor ‘‘Primary Option Menu’‘

cursor 3/12

key ‘‘pf2’‘

lookfor ‘‘* * * * *’‘

type ‘‘M.5’‘

key ‘‘enter’‘

lookfor ‘‘SDSF PRIMARY OPTION MENU’‘

type ‘‘prefix *’‘ key ‘‘enter’‘

key ‘‘pf9’‘

REM ------------------------ END OF SCRIPT ------------------------

 

 

Example 2:

 

REM ------------------------ BEGINNING OF SCRIPT ------------------------

 

REM Connect to Queens Library on port 23. Execute a search on Author,

REM then search for text, while text is not found, go to next screen.

REM Once the text is found, copy the screen to a disk file, close the

REM connection and exit the program.

 

port 23

connect qline.queensu.ca

lookfor "Queen's University"

type "qcat"

key enter

key home

type "a=heinlein, robert a."

key enter

 

dowhile (!search, "GALILEO")

 key pf8

loop

 

screentodisk "c:\galileo.txt"

 

type stop

key enter

close ""

 

REM ------------------------ END OF SCRIPT ------------------------

 

 

Example 3:

 

REM ------------------------ BEGINNING OF SCRIPT ------------------------

 

REM Connect to Queens Library, change to the local library, do a search on

REM keyword "mark", display and save to disk all screens until the end

REM of the index

 

port 23

connect qline.queensu.ca

lookfor Queen's

type libs

key enter

type local

key enter

type k=mark

key enter

type 1

key enter

screentodisk c:\mark.txt,5/1,12/80

dowhile (!search, "Last entry in index displayed")

 key pf6

 REM do not print the screen if the search string

 REM is displayed, because in that case we already have

 REM the screen in the file

 if (!search, "Last entry in index displayed")

  appendtodisk c:\mark.txt

 endif

loop

type stop

key enter

close

 

REM ------------------------ END OF SCRIPT ------------------------