[gui-talk] Fwd: New Interactive VBScript package for Window-Eyes

Steve Pattison srp at internode.on.net
Tue Dec 16 01:09:52 UTC 2008


From: Jamal Mazrui empower at smart.net
To: gw-scripting at gwmicro.com

This requires Homer Shared Object 5.7.
Jamal

Interactive VBScript 1.0

Press Shift-Windows-I to invoke Interactive VBScript (abbreviated 
InVbs):
a console mode environment for evaluating VBScript code and exploring 
the
Window-Eyes API, as well as other COM object models.  This is intended 
as
another resource for learning scripting by entering pieces of code and
getting immediate feedback.  The prompt is a greater than sign (>). 
Type
a VB statement to be executed, followed by Enter.  To evaluate code as 
an
expression instead, prefix it with the word 'print' or the question mark
symbol (?).  InVbs tries to output a useful result for any code entered,
so the question mark is usually not necessary unless the code could be
interpreted as either a statement or expression (e.g., x = y could be a
statement assigning y to x, or an expression testing whether x and y are
equal).  To execute more than one statement in a batch (e.g., statements
in a 'For' loop), seperate them with the colon symbol (:).  To repeat a
previous command, you can up arrow to it and press  Enter.

You probably want all punctuation to be read so that Window-Eyes
automatically reads the prompt for input (the Toggle Punctuation script
makes this setting convenient).  If output is more than 60 characters,
word wrapping occurs.  If it is more than 20 lines, you are prompted 
with
the following prompt:
More? (y/n/a)

Type y and Enter, or just Enter, for the next screen of text.  Enter n 
to
stop output and return to the input prompt.  Enter a for all output, 
which
scrolls without stopping.  This may be useful if you are logging a 
session
to a file.

The log and other commands are explained below.  They should be entered 
in
lower case at the beginning of the input area.  This syntax enables them
to be distinguished from other possible code that starts with the same
letters, since it can be typed with a leading space or diffrent
capitalization if necessary.  Many commands have a parameter that should
be seperated by a space and typed without surrounding quotes.  Some
commands may be abbreviated with a symbol.  Besides VBScript syntax, the
following built-in commands are available:

cd Directory = change directory.  If Directory is not specified, output
the current directory.  The default is the user profile folder.

cls = clear the screen.

cmd Command = pass Command to the Windows command interpreter, cmd.exe,
and output the result.  If Command is not specified, a Windows command
prompt is opened.  Abbreviate with the / symbol.

dir Object = list members of a COM object, including methods, 
properties,
and events.

edit File = open File in the Window-Eyes script editor (Notepad by
default, but configurable in the advanced settings of Script Manager).
Abbreviate with @ symbol.

exec File = execute a VBScript file in the current context.

help = output this documentation.

log File = start logging a session to File.  A ew text file is created
that records subsequent input and output.

log off = stop logging.

print Code = output the result of evaluating code as an expression.
Abbreviate with ? symbol.

quit or exit = close the console environment.

run Command = run Command as if entered in the Windows Start/Run dialog.
Abbreviate with ! symbol.

start File = launch File as a Window-Eyes script.  Abbreviate with *
symbol.

InteractiveVBScript.vbs is a global script hosted internally by
Window-Eyes.  It runs InVbs.vbs, which is hosted by the console version 
of
the Windows Script Host, CScript.exe.  Since the console environment is
hosted by a seperate process, code that references Window-Eyes objects
needs to include a reference to the Window-Eyes Application object.  The
global variable 'we' is assigned for this.  For example, you can refer 
to
the Keyboard object as we.Keyboard.

Another global variable is 'st' for the SayTools object that the script
also uses.  This free COM server is available at
http://EmpowermentZone.com/saysetup.exe

If the script does not find it installed, it offers to download it. 
Homer
Shared Object is also available as the 'hr' variable.

An array of input lines is maintained in the global variable called
'Inputs', e.g., Inputs(0) stores the first command entered, and
Inputs(UBound(Inputs)) stores the last.  Similarly, the 'Outputs' array
stores the output displayed after each input.  The 'r' variable also
stores the last result so it may be conveniently used as part of the 
next
command.  Finally, ActiveWindow and FocusedWindow refer to the active 
and
focused window objects that were present just before the console
environment was opened.

Regards Steve
Email:  srp at internode.on.net
Windows Live Messenger:  internetuser383 at hotmail.com
Skype:  steve1963 





More information about the GUI-Talk mailing list