JET 6530 Documentation > Scripting > Files
Script files
Structure of script files
Script files are plain text using the ISO-8859-1 character set. A
carriage return line feed sequence (CR LF), plain carriage return (CR)
and plain line feed (LF) are all accepted as line breaks. In normal
text files Windows uses CR LF for line breaks and Unix uses LF, so
text files created in either environment can be used as scripts. A
script is a series of commands that are executed in the order they
appear. Commands are terminated by line breaks. Sequences of one or
more spaces and horizontal tabs are white space and separate the
commands and their parameters. Keywords are recognised in upper, lower
and mixed case.
Commands
delay period
Pause for period seconds before executing the next command.
period is
a number greater than or equal to zero.
send keys
[ timeout
period]
Send the keys specified by keys to the host. If the keyboard is
locked the script will wait for it to unlock, unless the key to be
sent can normally be sent when the keyboard is locked. If after
period seconds since the send
command started the keys have not been
sent and the keyboard is locked then the script fails. keys is a
string literal. period is
a number greater than or equal to zero.
waitfor text
[ timeout period]
Wait for text to be received from the host. If after period seconds
text has not been received then the script fails. text is a string
literal. period is
a number greater than or equal to zero.
set keyboard
{on |
off}
Enables or disables user keyboard input. By default user keyboard
input is disabled while a script is running.
String literals
String literals start with a double quote character
(") and end with
either another double quote character, end of line or end of
file. The following escapes can be used in string literals:
| Escape |
Meaning |
| \a |
Bell |
| \b |
Backspace |
| \n |
Line Feed |
| \r |
Carriage Return |
| \t |
Horizontal Tab |
| \ooo |
Character whose encoding
is ooo, where ooo is an octal value between
000 and 377 |
| \x |
The character
x, where x is not one of the recognised escape
characters above |
| \\ |
Backslash |
| \" |
Double Quote |
The waitfor command's text
parameter and the send command's keys
parameter are string literals. Note that the special meaning of the
left square bracket ([) when
used in the send command's keys
parameter cannot be avoided by preceding it with a
backslash (\).
Numbers
Numbers are a sequence of decimal digits (0
to 9) and optionally one
full stop (.), which may be
preceded by a minus sign (-). For example, the
following are valid numbers:
The period parameter of the delay, send and waitfor
commands is a number.
Comments
The number sign (#) indicates
a comment. The number sign and
everything after it on that line are ignored.
JET 6530 keys
6530 keys corresponding to
graphic characters are represented by the
graphic character, except for left square brackets (see below).
6530 keys that are not graphic characters are represented by a key
name enclosed in square brackets
([ and ]).
The key names can be in upper, lower or mixed case. The following key
names are allowed:
The left square bracket key is represented by two left square bracket
characters ([[). Note
that a left square bracket preceded by a
backslash (\[) does not
represent the left square bracket key, it
marks the start of a key name, the same as a left square bracket
without a backslash.
If a key name is not valid then the script fails.
The JET 6530 keys that can be sent when the keyboard
is locked are:
break reset disconnect
Note that clipboard manipulation keys
(clear_selection, copy, cut, paste) cannot
be sent.
Host data
Data received from the host is filtered to remove everything except
graphic characters before being compared against the text of the
waitfor command.
Script storage and references
Scripts are text files on either the local file system or a web server
and are referenced by file: or http: URLs. The MIME type of a script
must be text/plain. Usually the browser will recognise the MIME type
of a file: URL as text/plain if the file name ends in ".txt". Most web
servers are configured to return a MIME type of text/plain with files
whose names have a ".txt" suffix.
For example, the following http: URL could be a script on a web
server:
http://www.platypuspartners.com/scripts/logon.txt
The following file: URL could be a script on the hard drive of a
Windows machine:
file:/C:/jetscript/auto.txt
The following file: URL could be a script on the file system of a Unix
machine:
file:/home/jsmith/jetscript/auto.txt
JET 6530 does not provide tools for creating scripts. A text file
editor such as Notepad under Windows or vi or emacs under Unix can be
used to create scripts.