StuffKey Utility v1.0

(Last modified: 20Aug2004)

This document (2948742) is provided subject to the disclaimer at the end of this document.

Associated File

Click the filename to download: stufkey5.exe 107269 bytes 20Aug2004 04:06PM

Abstract

STUFFKEY.NLM allows you to send keystrokes to any program on any screen. This gives you to ability to automate processes that require user input.

NOTE: This utility helps system administrators and developers. It is provided free of charge as a courtesy, and therefore, is not a Novell supported product. 8\20\2004 readme change only

Installation Instructions

n/a

Issue

STUFFKEY.NLM
Version 1.20 for NetWare v3.x, 4.x, 5
Copyright (C) 1998,1999 Novell, Inc.
All Rights Reserved

________________________________________

CONTENTS
________________________________________

I. Abstract
II. Installation Instructions
III. Usage
IV. Product Description
V. Enhancements/Bug Fixes
VI. Known Issues
VII. Frequently Asked Questions

________________________________________

I. ABSTRACT
________________________________________

STUFFKEY.NLM allows you to send keystrokes to any program
on any screen. This gives you to ability to automate
processes that require user input.

NOTE: This utility helps system administrators and developers.
It is provided free of charge as a courtesy, and therefore,
is not a Novell supported product.

II. INSTALLATION INSTRUCTIONS
________________________________________

Copy STUFFKEY.NLM to the SYS:\SYSTEM directory on your server.

NOTE: 3.12 servers require CLIB 3.12l or greater and CLIBAUX.NLM.
        4.10 servers require CLIB 4.11o or greater
        4.11 servers require service pack 5 or greater

        If the above requirements are not met, Stuffkey may not
        be able to load because of unresolved symbols.

________________________________________

III. USAGE
________________________________________

Loading:

     stuffkey [CommandFile [options]] [/?]

For help do:

     load stuffkey ? | /?

________________________________________

IV. PRODUCT DESCRIPTION
________________________________________

STUFFKEY.NLM allows you to send keystrokes to any program
on any screen. This gives you to ability to automate
processes that require user input.

USAGE: stuffkey [CommandFile [options]] [/?]

            CommandFile = Full pathname of command file (See Examples)
            Options = preface option(s) with '-' or '/' (eg -sv)
                        d=n - Delay n milliseconds between characters
                        s - do not view target Screens during execution
                        r - Return to original screen when completed
                        v - Verbose mode (shows progress on console)
                        ? - Display help message

     Description:
          Allows keystrokes to be passed to another screen.

          StuffKey uses a command file which contains the screen name
          on the first line on which to issue the keystrokes.
          All successive lines contain either plain text or tokens
          representing special keys. Note that Newline characters
          in the file are ignored; the <CR> token must be used if
          a newline character is to be sent to the screen.

          A default intercharacter delay of 50 milliseconds is used
          unless it is overridden with the /d switch.

     Command File:
          The first uncommented line of the command file contains the
          initial screen name (case insensitive). The <SCREEN=xxx>
          token is used to specify the initial screen.

          All successive lines contain text and tokens consisting
          of printable ASCII characters. All non-token characters
          are taken literally. Imbedded newline characters in the
          file are ignored. Newlines (Enter) are sent to the screen
          using the <CR> token.

          Comments are marked by # or ; as the first charcter
          of the line. To specify a \ or < preface it with a \.

        Tokens:
            Syntax: <[count] token | \x>
                    Where x can be any ASCII character
            - All tokens are enclosed in <>.
            - The first characters of any token can be a repeat count,
              which will repeat that token value or character n times.
              Literal characters can be repeated using the \x format.
            - Tokens are case-insensitive

            Special:
                PAUSE (used with count to pause playback n msec.)
                      for example <5000 pause> will pause for 5 secs
                LOG NEW|APPEND=LogFilePath
                      Open a log file in preparation for the DUMP token.
                      NEW will create or destroy an existing log,
                      APPEND will will create or append to an existing log.
                      The full NetWare path and filename should be specified;
                      Only DOS filenames (8.3 format) are supported.
                DUMP
                      Dump the current screen to the log file
                SCREEN=ScreenName
                      Switch to ScreenName as current screen.
                      Stuffkey will terminate if ScreenName doesn't exist.
                WAITFOR SCREEN=ScreenName
                      Wait for ScreenName to be available and make it current
                WAITFOR NOSCREEN=ScreenName
                      Wait for ScreenName to become unavailable (removed)
                      and default to System Console as the current screen
                WAITFOR TEXT=Any Text
                      Wait for Any Text to appear within the current screen

                      A timeout in minutes can be specified before WAITFOR
                      (default is 2 minutes)
                      example: <5 WAITFOR Text=Enter Login Name>
                        (Wait for 5 minutes for the text to appear)

            Unmodified Keys:
                CR, BS, TAB, ESC, HOME, END, PGUP, PGDN, LEFT, RIGHT,
                UP, DN, INS, DEL, F1...F10
            Shifted Keys:
                SF1...SF10
            Control Sequences:
                CLEFT, CRIGHT, CHOME, CEND, CPGUP, CPGDN, CBACKSLASH,
                CLBRACKET, CRBRACKET, CDASH, CTLA...CTLZ, CF1...CF10
            Alt Sequences:
                ADASH, AEQ, ALTA...ALTZ, AF1...AF10, A0...A9

       Known Issues/Problems:
            CPGUP & CPGDN will not work in the C-Worthy (NUT) user
            interface. CPGDN is treated like CR.
            CPGUP is simply invalid.

            When you close out the current screen by exiting the
            application that owns it, you must switch to a known good
            screen before executing any further commands that will
            attempt to output any characters, otherwise the OS will
            return Invalid Screen ID errors.
            Use the <SCREEN=xxx> or <WAITFOR SCREEN=xxx> tokens to
            switch to another screen.

       Running Stuffkey Examples:

            load stuffkey sys:cmds/fixall.txt /v
            (execute commands in sys:cmds/fixall.txt in verbose mode)

            load stuffkey sys:mycmds.sk /s
            (execute mycmds.sk and don't display any target screens)

            load stuffkey sys:mycmds.sk /d=5
            (execute mycmds.sk with 5ms intercharacter delay)

       Example Command Files:

            Example 1: (Load and navigate an NLM's Screen)
            # Load DSREPAIR and Repair local DS database
            #--------------------------------------------
            # Start at the console screen and load dsrepair
            <screen=System Console>
            load dsrepair<cr>
            # Wait for the dsrepair screen to be created and make it current
            <waitfor screen=dsrepair status screen>
            # Go to Advanced options menu in dsrepair
            adv<cr>
            # Go to Repair local DS database menu option
            rep<cr>
            # Set option to Exit automatically and execute
            <6dn>Y<cr><f10>

            Example 2: (Waiting for NLMs to unload)
            # Unload NLMs in sequence
            #--------------------------------------------
            # Go to an NLM's screen and exit from it
            <screen=Web Server Screen>
            <af10>Y<cr>
            # Waitfor the NLM's screen to terminate
            <waitfor noscreen=web server screen>
            # The screen is now gone and we are at the system console
            # screen. We can now unload its library
            unload weblib<cr>
            <waitfor text=module weblib.nlm unloaded>

            Example 3: (Waiting for screens and text)
            # Load oracle and login to the database
            #--------------------------------------------
            <screen=System Console>
            # Start Oracle
            oraload
            # wait for the oraconfig screen
            <waitfor screen=oracle configuration screen
            # Login option is down 2 items in the menu
            <2dn><cr>
            # Wait for the prompt
            <waitfor text=login name>
            scott<cr>tiger<cr>

            Example 4: (Logging)
            # Gather configuration information
            #--------------------------------------------
            <screen=System Console>
            # Open a new log file (remove it if it already exists)
            <log new=sys:etc/sklog.txt>
            # Get configuration information from the server
            config<cr>
            # Dump the screen to the log to capture the information
            <dump>
            # Just in case there's more, press Enter to get the last page
            <cr>
            # Dump the screen again to the log file to get any new info
            <dump>

________________________________________

V. ENHANCEMENTS/BUG FIXES
________________________________________

Beta 0.01
  - First Release
Beta 0.02
  - Added SCREEN token to enable switching to other screens
Beta 0.03
  - Added ability to load it multiple times
  - It now reports the script name in "completed" message
1.00
  - Removed from beta status to general release
1.01
  - Failed to find screen if screen name had trailing spaces
  - Allow screen token as initial screen name since many
    were confused about that two ways to specify screens.
  - PGDN token is now recognized
1.2
  - Allow spaces after a repeat number <nnnn token>
  - Added <waitfor noscreen=xxx> token
  - Added <LOG> and <DUMP> tokens
  - Doc clarification and added samples
________________________________________

VI. KNOWN ISSUES
________________________________________

Issue 1:
CPGUP and CPGDN do not work in the C-Worthy (NUT) user
interface. CPGDN is treated like CR, CPGUP is simply invalid.

Issue 2:
When you close out the current screen by exiting the
application that owns it, you must switch to a known good
screen before executing any further commands, otherwise
stuffkey will return an Invalid Screen ID error.
It's always safe to switch to System Console.

________________________________________

VII. FREQUENTLY ASKED QUESTIONS
________________________________________

Q: Is there a recording feature to record my keystrokes?
A: Not currently. Building the command file is a
   a manual process.

Q: Is there a limit to the size of the command file?
A: No.

Q: Can I specify multiple screens in one command file?
   Often I need to switch to multiple screens such as
   when I am automating SBACKUP.
A: Yes, you specify new screens with the SCREEN token
   anywhere within the script. It's also handy to use
   the <waitfor screen=xxx> token to wait for a
   screen to be created before switching to its screen.

Novell Product and Version:
NetWare 3.12
NetWare 3.2
NetWare 4.11
NetWare 5

File Contents

Self-Extracting File Name:  stufkey5.exe

Files Included       Size   Date         Time    Version   Checksum

\
  STUFFKEY.NLM      29809   04Mar1999    09:01AM
  STUFKEY5.TXT      13062   20Aug2004    04:06PM

document

Document Title: StuffKey Utility v1.0
Document ID: 2948742
Creation Date: 08Mar1999
Modified Date: 20Aug2004
Revision: 2
Novell Product Class:NetWare

disclaimer

The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information.
Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.