Abra is a library of commands that can be used in other programs.
If you were looking at the documentation of another program, and jumped here, then you can use Abra's commands and scripts in that program.
- copy -- copy a file
Syntax:
copy filename destination
- filename -- the file to copy (no wildcards)
- destination -- the destination file to copy to
- ren -- Rename a file or directory
Syntax:
ren filename newname
- filename -- The file or directory to rename.
- newname -- The new name of the file or directory.
Notes: You can also move a file from one place to another with this command, but you cannot move a directory.
- del -- Delete files
Syntax:
del filespec
- filespec -- The files to delete (you can use standard DOS wildcards).
- md -- Make a directory
Syntax:
del dirname
- dirname -- The name of the directory to create.
- rd -- Delete directories
Syntax:
rd dirname
- dirname -- The directory to remove (must already be empty).
- wait -- Interupt processing of commands
Syntax:
wait n
- n -- Number of seconds to wait before continuing what you were doing.
Examples:
- wait 15 -- Wait 15 seconds before allowing any other commands to be processed.
- onTop -- Make windows always on top.
Syntax:
ontop [no] WindowTitle
- no -- If 'no' is specified, we're removing this windows always on top status.
- WindowTitle -- Title of the window to make on top/not on top.
Examples:
- ontop notepad -- Make notepad always on top.
- ontop no notepad -- Make notepad a normal, not always on top window.
- winMove -- Moves a window to a screen position.
Syntax: winmove x y WindowTitle
- x -- The x coordinate to move the window to.
- y -- the y coordinate.
- WindowTitle -- The title of the window to move - case sensitive.
Example:
- winmove 0 300 ForeMenu -- Move ForeMenu to position (0,300).
- winSize -- Changes the size of a window.
Syntax: winsize width height WindowTitle
- width -- The new width of the window.
- height -- The new height of the window.
- WindowTitle -- The title of the window to size - case sensitive.
Example:
- winsize 500 30 ForeMenu -- Make ForeMenu be 500x30 in size.
- winMoveSize -- Changes the position and size of a window.
Syntax: winmovesize x y width height WindowTitle
- x -- The x coordinate to move the window to.
- y -- The y coordinate to move to.
- width -- The new width of the window.
- height -- The new height of the window.
- WindowTitle -- The title of the window - case sensitive.
Example:
- winmove size 0 300 500 30 ForeMenu -- Move ForeMenu to position (0,300) and make it be 500x30 in size.
- winActivate -- Makes the window be the active window.
Syntax: winactivate windowTitle
- windowTitle -- The title of the window to activate.
Note: Since the sendkeys command sends keystrokes to the active window, you can use this command first, to activate the one you want.
Example:
- winActivate Write -- Make Write be the active window.
- winClose -- Closes a window.
Syntax: winclose WindowTitle
- WindowTitle -- The title of the window to close.
Example:
- winClose Write -- Close the Write window.
- sendKeys -- Pass keystrokes to a window.
Syntax: sendkeys [wait] keys
- wait -- Don't let anything else happen until the window processes the keystrokes.
- keys -- The keystrokes to be passed.
Notes: The keystrokes are sent to the active program. You should use "wait" to ensure that the right program gets the keypresses. It will prevent you from changing which program is active and sending the keystrokes to the wrong place.
See the Sendkeys key format doe details on the key syntax.
Example:
- run notepad.exe -- Loads notepad, making it the acive program.
- sendkeys wait %fo -- Passes the keystorkes alt+f+o to the active program. The keys passed to notepad will make it display its "open" dialog.
- run - Runs a program.
Syntax: [run] [+|-|*] [@dir] [path]program [params]
- + -- Run in full screen mode.
- - -- Run as an icon.
- * -- Run hidden.
- @dir -- Directory to start the program in.
- path -- Path to the program. Can be omitted if the program is on the DOS path, or is in the current directory.
- program -- The program or script to run.
- params -- Parameters that should be passed to the program.
Examples:
- progman -- Run program manager. Or you could use "run progman" or "run progman.exe".
- run + @ c:\mine c:\windows\write c:\mine\paper.wri -- Change to the directory "c:\mine", and run Write, in full screen mode, loading the file c:\mine\paper.wri.
- cd - Changes to a directory.
Syntax: cd dirname
- dirname -- Name of the directory to change to. Can include a drive.
Example:
- cd a:\mine -- Change to the directory "mine" on the A drive.
- message -- Display a message.
Syntax: message text of message
The text of the message is displayed in a box until you press the OK button. You can use system variables in the text of the message.
- exit -- Exit the program, but not Windows.
exitwin - Exits windows, and optionally reboots or restarts the computer.
Syntax: exitwin [restart|reboot|run progname params]
- restart -- Exit and restart windows.
- reboot -- Exit windows, and reboot the computer.
- run progname params -- Exit windows, run the program "progname" with the parameters "params", and return to windows.
- Default: Exit windows.
If you need to run several commands one after another, you can use scripts to automate the process.
A script is simply a list of commands, saved to a file with the extention .scr. The run command will process each command in the script file in order.
If you want to put a comment line in a script, preceed the commant with a ';'.
(This description taken from the Visual Basic help on Sendkeys, and modified to correspond to ForeMenu)
Each key is represented by one or more characters. To specify a single keyboard character, use the
character itself. If you want to represent more than one character, append each additional character to the one preceding it. To represent the
letters A, B, and C, use ABC for exp.
The plus sign (+), caret (^), percent sign (%), tilde (~), and parentheses ( ) have special meanings to
sendKeys. To specify one of these characters, enclose it inside braces. For example, to specify the
plus sign, use {+}. Brackets ([ ]) have no special meaning to sendKeys, but you must enclose them
in braces as well, because in other applications for Microsoft Windows, brackets do have special
meaning that may be significant when dynamic data exchange (DDE) occurs. To send brace
characters, use {{} and {}}.
To specify characters that aren't displayed when you press a key (such as Enter or Tab) and keys that
represent actions rather than characters, use the codes shown below:
- Backspace: {BACKSPACE} or {BS} or {BKSP}
- Break: {BREAK}
- Caps Lock: {CAPSLOCK}
- Clear: {CLEAR}
- Del: {DELETE} or {DEL}
- Down Arrow: {DOWN}
- End: {END}
- Enter: {ENTER} or ~
- Esc: {ESCAPE} or {ESC}
- Help: {HELP}
- Home: {HOME}
- Ins: {INSERT}
- Left Arrow: {LEFT}
- Num Lock: {NUMLOCK}
- Page Down: {PGDN}
- Page Up: {PGUP}
- Print Screen: {PRTSC}
- Right Arrow: {RIGHT}
- Scroll Lock: {SCROLLLOCK}
- Tab: {TAB}
- Up Arrow: {UP}
- F1: {F1}
- .
- .
- .
- Fn: {Fn}
To specify keys combined with any combination of Shift, Ctrl, and Alt keys, precede the regular key
code with one or more of the following codes:
- Shift: +
- Control: ^
- Alt: %
To specify that Shift, Ctrl, and/or Alt should be held down while several other keys are pressed,
enclose the keys' code in parentheses. For example, to have the Shift key held down while E and C
are pressed, use +(EC). To have Shift held down while E is pressed, followed by C being pressed
without Shift, use +EC.
To specify repeating keys, use the form {key number}; you must put a space between key and
number. For example, {LEFT 42} means press the Left Arrow key 42 times; {h 10} means press
h 10 times.
Note: SendKeys can't send keystrokes to an application that is not designed to run in Microsoft
Windows. Sendkeys also can't send the Print Screen (PRTSC) key to any application.
System variables are special codes that are changed to realtime information.
These expressions are case sensitive.
- %date% -- the date
- %time% -- the time
- %mem% -- free memory in K
- %sys% -- percent free system resources
- %gdi% -- percent free GDI
- %user% -- percent free user resources
These can be combined in any way you like, for example:
- %date% - %mem%KB free
- Sys:%sys%% GDI:%gdi%% User:%user%%