www.brianapps.net - Sizer Railroad Diagrams

Syntax diagrams

The syntax for Sizer expressions and macros is shown below in as railroad diagrams. Macros follow the macro diagram; and expressions follow the expression diagram.

Used to to set options during the execution of a macro. Supported options are:

compensate_frame_effectsControls whether to adjust sizes to account for frame effects. See Compensate for Frame Effects for more information
ignore_runtime_errorsWhen set to on runtime errors (i.e. index out of range in a window-qualifier) are silently ignored and the macro continues running. The default value is off, which means the macro stops execution when it encounters an error and reports it to the user.

Variable names always starts with $. Variables can be defined anywhere in the macro. Variables must be assigned a value before being used. Variables beginning with an unscore are reserved for use by Sizer and the behaviour is undefined if the user uses a variable that begins with an underscore.

The resize-block applies the resize actions to one or more windows that match the window-qualifier. If a * is specified after the window-qualifier then all windows that match will be resized, otherwise only the first window that matches is resized. Sizer will set the variable $_index to the 1 based index for the window being processed. This allows each window to be positioned differently. For example the follow macro places all instances of notepad in a grid pattern with 4 columns:

resize : proc[notepad]*
    t = 300 * (($_index - 1) \ 4)
    l = 400 * (($_index - 1) % 4)
    w = 400
    h = 300
          

A window-qualifier is used to specify which window should be resized.

activeThe main window of the application that is currently active. Also referred to as the foreground window.
lastThe window used by the previous resize action. If last is used in the first resize macro then the active window is used.
procFinds one or more windows whose process is owned by an executable with a name that contains text. e.g. to find windows owned by notepad.exe use proc["notepad.exe"]
capFinds one or more windows whose title (or caption) contains text. e.g. to find windows with readme.txt in the title use cap["readme.txt"]
desktopRestrict windows to the current desktop if running with multiple desktops.
numberSelect which window to use (when multiple windows match the process or caption) using a 1-based index.

Adjusts a dimension of the window being resized (as per the window-qualifier in the resize-block).

tTop coordinate of the window in pixels.
lLeft coordinate of the window in pixels.
wWidth of the window in pixels.
hHeight of the window in pixels.

*Multiplication.
/Floating point division.
\Integer division - returns floor(a/b).
%Remainder of a / b.

Obtain a dimension of an existing window or monitor. The first character describes which dimension to take.

tTop of the window or monitor.
lLeft the window or monitor.
rRight of the window or monitor.
bBottom of the window or monitor.
wWidth of the window or monitor.
hHeight of the window or monitor.

Following this character is a description of the window or monitor to use. By default the active monitor is used.

clientThe client area (usually the part of the application inside the window frame and menu).
winThe entire window frame including the border and title bar.
monA monitor attached to the system.
workareaThe work area is the area on a monitor not including the taskbar.

A monitor-qualifier is used to specify which monitor to extract dimensions from.

activeThe monitor on which the active window resides.
primaryThe monitor set to be the primary monitor.
numberA one based index of the monitor to use.