What's new in QM 2

This topic contains information about importing and converting QM1 macros.

File format

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

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:

  1. Now all identifiers are case sensitive. All intrinsic keywords are lowercase. For example, Lef is now illegal; must be lef.
  2. Now you cannot type more alphanumeric characters after keywords. For example, left is now illegal; must be lef or lef't.
  3. 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.
  4. Command "text" (paste text): multiple lines must be separated with [] (e.g., "line1[]line2"). To enclose selected text ("???") use function Enclose.
  5. Empty lines now do nothing (was 100 ms delay).
  6. 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.
  7. Parts of FILE commands must be separated with space (was >). File path must be enclosed with quotes, unless it is variable.
  8. The run command now is used differently.
  9. Syntax id=n window changed to id(n "window").
  10. Commands win and chi replaced with functions win and child.
  11. The got command changed to goto; unh to hid-; noo to ont-; xmouse to xm; ymouse to ym.
  12. 0 (end macro) changed to end.
  13. Changed wait for ... syntax.
  14. Other commands with changed syntax or behavior: ifa, ifi, rep, tim, mac, dis ...
  15. * Some commands have extended syntax, and may behave differently than in QM1.
  16. * The mes command changed to the list. Added new function mes.
  17. * The do keyword is no longer supported. Instead, following n lines must be tab-indented.
  18. * Variables and string functions changed completely. var, reg, str, ifv and ifs are no longer supported.
  19. * Not supported in this version: lis, new, map, ite, par, "???".
  20. * Now macro ends on errors, such as "window not found", etc, unless err or opt err 1 is used.
  21. 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

  1. 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.
  2. To view keyword help, click it and press F1.
  3. Use the Find dialog to find and replace text in multiple macros.
  4. 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.
  5. 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.