BUILT-IN INSTRUCTIONS
It can be used on of special built-in instruction in place of execution commands.
This instructions is executed by Runner itself.
Instructions as well as commands is planned on time or events. Time field of
the schedule command line contains instruction same as another time fields.
Instructions differs from command by first char of the command field.
This char is ">" ("GT"), after it (without whitespaces)
must be placed instruction name. Other part of line depends on instructions
kind.
Any modifiers can not be used with built-in instructions.
Instructions may be used to control working of the Runner, for
service and for task planning. There are three kind of instructions:
-
Instruction to control Runner's work
- ex - to exit Runner.
- Format: time >ex
- Simple: 23:50 >ex
- sl - to "sleep" Runner. On execution of this
instruction program stops during defined time, free resources and
hide icon.
- Format: time >sl=sleep time in minutes
- Sample: 08:00 >sl=60 - sleep from 8:00 to 9:00
Main purpose of this onstruction - to free resources during the time
of the most usage. For example, program can sleep daily and work
at the night.
- re - to reload schedule. On execution of this
instruction schedule file will be loaded and interpreted. Commands, which
has a time point as delay from the start of the Runner, not executed.
- Format: time>re
- Sample: 06:00 >re - schedule will be loaded on 6:00.
- hd - hide icon. Result of this instruction - removing
of the Runner's icon from the SysTray. Without icon program is not accessible
for user with menu, but continue to work.
To show icon again it can be used instruction sw on predefined
time, or start of second hinstance of the Runner. In last case, second copy
of the Runner, report to user about the first hinstance with standard
dialog, and send the first hinstance
message to show icon.
- Format: time>hd
- Sample: 09:30 >hd - on 9.30 hide
See also option hd.
- sw - to show icon. Inverse instruction for
hd. If icon not visible, it will be show
- Format: time>sw
- Sample: 18:30 >sw - show icon on 18:30
-
Instruction to control applications. This kind of instructions extends posiibility
of the Runner to control other applications.
- fw
- to manipulate windows ("find window").
This instruction was developed to control windows (and applications created it),
including resizing and moving windows, hide/show/minimize/maximize windows,
close windows and terminate applications, emulating mouse and keyboard events.
In addition, this instruction allows to execute any schedule command or built-in
instruction as reaction on existing of target window in a system. Instruction
allows to use as a target TOP-LEVEL windows (which has a title string
and can be free moved over desktop) as well as CONTROLS (buttons, text
edit windows, etc.). Any control is a window. All windows in a system has property
text (some of windows have empty text). Text of a top-level window
is a caption, placed into the title string, text of a control - string
placed over control or inside of text-edit window. Except text property,
every window also have property class, which is not empty name of class
of this window. Thus, enumerating top-level windows, it is possible select one
or more of they, using text or class name as the criterion. For
every of selected windows it is possible to execute one of the above-stated operations
or enumerate child controls in the same way and execute an operation for those of
them, which was selected using same criterions. Instruction fw
do this.
Format of this instruction is following:
time>fw{criterion}=operation
where
- ie - user input emulation. This instruction will emulate
user's actions with keyboard (press and release) and mouse (move and click).
Instruction ie allows emulate user's action without relation with
windows. It works on driver level, activate OS reaction, as against
fw. Format:
time >ie=macro
Macros consists of the number of event records using following rules:
- alphanumeric and other printable keys emulation records using small
letter, digit or other character drawed on the key
- to emulate unprintable special keys, use following keywords (upper
case):
ESC ENTER SHIFT ALT CTRL SPACE CAPS TAB F1 .. F12 BS (BackSpace)
INS HOME PGUP DEL END PGDN
UP DOWN LEFT RIGHT (arrows keys)
PRINTSCREEN SCROLL (Scroll Lock) PAUSE
NUM0 .. NUM9 NUMPOINT GREY+ GREY- GREY* GREY/ GREYENTER
- to emulate key down (without key up), place character '<' before
key code or keyword. To "release" key, simply place character '>'.
Last downed key will be released. For example, to call menu File
(Alt + F) use "<ALT <SHIFT f>>".
- to emulate mouse events, use following keywords:
- LBUTTON - left button event
- RBUTTON - right button event
- DLBUTTON - left button doubleclick
- DRBUTTON - right button doubleclick
- MOVE(X,Y) - move cursor to screen point (X,Y)
- MOVER(dX,dY) - move cursor at dX,dY offset from current position
- MOVEW(x,y) - move cursor at point(x,y) of foreground window
to down button use same method as for keyboard (charackters '<' and '>').
For example, to draw "A" in MSPaint, use macros:
"MOVEW(100,200)<LBUTTON MOVEW(150,100)MOVEW(200,200)> *+
MOVEW(125,150)<LBUTTON MOVEW(175,150)>"
- default pause from one event to next is 100 milliseconds. To set
default pause use expression DEFDELAY(XXX), XXX - new value, ms.
To set one-time pause between commands, use DELAY(XXX), XXX - duration
of pause. Max values 2^32 (4e9) milliseconds.
- additional windows control may be processed using expressions:
- ACT(xxxx) - set window has title contains text "xxxx" as foreground
- SHOW(xxx) - show (restore) window;
- HIDE(xxx) - hide window;
- MIN(xxx) - minimize window;
- MAX(xxx) - maximize window;
- CLOSE(xxx) - send command "Close" to window;
if use this keywords without brackets, it will be targetted to foreground
window. If add suffix "ALL" to any of these commands, it will be targetted
to all windows of this kind.
- WINMOVE(X,Y) - move foreground window to screen point X,Y
- WINMOVER(dX,dY) - move foreground window using offsets dX,dY
following fragment may be used as separated sample schedule to illustrate
this instruction
; ===== begin Runner schedule
[ev]
~#mspaint
+3>ie=DEFDELAY(50)ACT(Paint)<CTRL <SHIFT n>>*+
MAX MOVEW(120,220) <LBUTTON MOVER(0,-100) MOVER(0,50) MOVER(30,0)*+
MOVER(0,-50)MOVER(0,100)>MOVER(30,0)<LBUTTON *+
MOVER(0,-80)MOVER(20,0)>MOVER(-5,40)<LBUTTON *+
MOVER(-15,0)MOVER(0,40)MOVER(20,0)>*+
MOVER(30,0)<LBUTTON MOVER(0,-80)>*+
MOVER(30,0)<LBUTTON MOVER(0,80)>*+
MOVER(-35,0)<LBUTTON MOVER(10,0)>MOVER(20,0)<LBUTTON MOVER(10,0)>*+
MOVER(30,0)<LBUTTON MOVER(0,-80)MOVER(20,0)MOVER(0,80)MOVER(-20,0)>*+
<CTRL f>DELAY(3000)CTRL <CTRL <SHIFT n>> CLOSE TAB ENTER
+15>ex
; ===== end Runner schedule