What's new in QM 2
This topic contains information about importing and converting QM1 macros.
In QM1, text of each macro was saved in separate file (*.oqm). Other properties
were saved in single List.ini file. The List.ini file was in QM folder. The
macro files were in m subfolder. Now all data is in single file (*.qml).
To convert your old files to the new format, click the Convert... button in
Options -> Files, and find the List.ini file. QM will convert file format
and show message with converted file name. It also imports the converted file
and the Convert old macros.qml file.
Macro commands are significantly changed. You have to convert all your old
macros, or they will not work. To automate this process, use macro CM_Main (from
the Convert old macros folder). Convert each macro separately: open it and press
hot key for CM_Main (Shift+F8). It will convert and replace macro text. Warning:
do not use it with new or already converted macros. Warning2: possible errors
or partial conversion. Some commands (below marked *)
must be converted manually.
Below are listed the main changes:
- Now all identifiers are case sensitive. All intrinsic keywords are lowercase.
For example, Lef is now illegal; must be
lef.
- Now you cannot type more alphanumeric characters after keywords. For example,
left is now
illegal; must be lef or
lef't.
- Now key
must be used to press keys. For example, if was AT
, now must be key
AT. Also can be 'AT. Key codes are the
same, although syntax is extended. Quotes, parentheses and semicolon now are
special symbols.
- Command "text" (paste text): multiple
lines must be separated with [] (e.g., "line1[]line2").
To enclose selected text ("???") use
function Enclose.
- Empty lines now do nothing (was 100 ms delay).
- With most commands, strings must be enclosed with quotes. Also can be used
variables. For example, act
Notepad now must be act
"Notepad". Some character sequences
in strings ('', [],
[digits]) are replaced to special characters.
- Parts of FILE commands must be separated with space (was >). File path
must be enclosed with quotes, unless it is variable.
- The run
command now is used differently.
- Syntax id=n window changed to
id(n "window").
- Commands win and chi
replaced with functions win
and child.
- The got command changed to goto;
unh to hid-; noo
to ont-; xmouse to xm;
ymouse to ym.
- 0 (end macro) changed to end.
- Changed wait for ... syntax.
- Other commands with changed syntax or behavior: ifa,
ifi, rep, tim,
mac, dis
...
- * Some commands have extended syntax, and may
behave differently than in QM1.
- * The mes command changed
to the list.
Added new function mes.
- * The do keyword is
no longer supported. Instead, following n lines must be tab-indented.
- * Variables
and string functions changed completely.
var, reg, str,
ifv and ifs are no longer
supported.
- * Not supported in this version:
lis, new, map,
ite, par, "???".
- * Now macro ends on errors, such as "window
not found", etc, unless err
or opt err 1
is used.
- Menus and toolbars also must be converted. "file" items have
changed/extended syntax;
* is not needed for default icon; changed syntax of setting toolbar
startup position.
Tips for converting
- Now, before macro starts to run first time, it is compiled
(automatically). If there are some errors,
macro does not run. On error, error place is highlighted, and error message
is displayed in the QM output.
- To view keyword help, click it and press F1.
- Use the Find dialog to find and replace text in multiple macros.
- Some removed features, and many new, now implemented as user-defined functions.
For example, "???" (enclose selected text) now is implemented as
function Enclose. They are in the System\Functions
folder.
- After you convert file format, you can delete old files (List.ini and whole
m subfolder). Also you should delete or disable the Convert old macros folder.