NOVELL TECHNICAL INFORMATION DOCUMENT TITLE: StuffKey Utility v1.0 TID #: 2948742 README FOR: stufkey5.exe SUPERSEDES: STUFKEY4.EXE NOVELL PRODUCTS and VERSIONS: NetWare 4.2 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 ----------------------------------------------------------------- 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. ----------------------------------------------------------------- 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 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 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 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 or 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 load dsrepair # Wait for the dsrepair screen to be created and make it current # Go to Advanced options menu in dsrepair adv # Go to Repair local DS database menu option rep # Set option to Exit automatically and execute <6dn>Y Example 2: (Waiting for NLMs to unload) # Unload NLMs in sequence #-------------------------------------------- # Go to an NLM's screen and exit from it Y # Waitfor the NLM's screen to terminate # The screen is now gone and we are at the system console # screen. We can now unload its library unload weblib Example 3: (Waiting for screens and text) # Load oracle and login to the database #-------------------------------------------- # Start Oracle oraload # wait for the oraconfig screen # Wait for the prompt scotttiger Example 4: (Logging) # Gather configuration information #-------------------------------------------- # Open a new log file (remove it if it already exists) # Get configuration information from the server config # Dump the screen to the log to capture the information # Just in case there's more, press Enter to get the last page # Dump the screen again to the log file to get any new info ________________________________________ 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 - Added token - Added and 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 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 Self-Extracting File Name: stufkey5.exe Files Included Size Date Time ..\ STUFKEY5.TXT (This file) STUFFKEY.NLM 29809 3-4-1999 9:01:44 am ----------------------------------------------------------------- Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information. -----------------------------------------------------------------