The syntax for Sizer expressions and macro is shown below 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:
| Option | Description |
|---|---|
compensate_frame_effects | Controls whether to adjust sizes to account for frame effects. See Compensate for Frame Effects for more information. |
ignore_runtime_errors | When 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 underscore 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 the filter will be resized, otherwise only the first window matched is resized. Sizer will set two special variables:
$_index is set to the 1 based index for the window being processed.$_count is set to the number of windows that where matched.These variables allow each window to be positioned differently. For example the following 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.
| Qualifier | Description |
|---|---|
active | The main window of the application that is currently active. Also referred to as the foreground window. |
last | The window used by the previous resize action. If last is used in the first resize macro then the active window is used. |
proc | Finds one or more windows whose process is owned by an executable with a name that contains the given text. e.g. to find windows owned by notepad.exe use proc["notepad.exe"] |
cap | Finds one or more windows whose title (or caption) contains the given text. e.g. to find windows with readme.txt in the title use cap["readme.txt"] |
desktop | Restrict windows to the current desktop if running with multiple desktops. |
number | Select 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).
| Dimension | Description |
|---|---|
t | Top coordinate of the window in pixels. |
l | Left coordinate of the window in pixels. |
w | Width of the window in pixels. |
h | Height of the window in pixels. |
| Operator | Description |
|---|---|
+ | Addition. |
- | Subtraction. |
| Operator | Description |
|---|---|
* | Top coordinate of the window in pixels. |
/ | Left coordinate of the window in pixels. |
\ | Width of the window in pixels. |
% | Height of the window in pixels. |
Obtain a dimension of an existing window or monitor. The first character describes which dimension to take.
| Param | Description |
|---|---|
t | Top of the window or monitor. |
l | Left the window or monitor. |
r | Right of the window or monitor. |
b | Bottom of the window or monitor. |
w | Width of the window or monitor. |
h | Height 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.
| Param | Description |
|---|---|
client | The client area (usually the part of the application inside the window frame and menu). |
win | The entire window frame including the border and title bar. |
mon | A monitor attached to the system. |
workarea | The work area is the area on a monitor not including the taskbar. |
A monitor-qualifier is used to specify which monitor to extract a dimensions from.
| Qualifier | Description |
|---|---|
active | The monitor on which the active window resides. |
primary | The monitor set to be the primary monitor. |
number | A one based index of the monitor to use. |