Text-sensitive menus (TS menus) are used to execute commands when you type certain text. Typical usage - text replacement/autocomplete/autocorrect/autotext.
A TS menu has no visible interface. When you type text somewhere, and the text matches one of menu items, executes its command.
A TS menu works only if it has a trigger.
Added in QM 2.3.3.
Assume you have this TS menu with 2 items (the "/b/i/c/p3" sets options):
/b/i/c/p3 sun :'"Sunday" mon :'"Monday"
When you type "sun" and a delimiter character (for example space), it replaces the text with "Sunday " (erases "sun " and types "Sunday "). Or you can press Ctrl instead of a delimiter character. When you type "mon ", replaces with "Monday ".
This trigger does not require an event (hot-key etc) before typing text. It just tells QM to make the TS menu active. Only TS menus can have this trigger.
To assign this trigger, use the Properties dialog. You can set programs where the TS menu works, and a filter function. Also you can set prefix text; for example, if prefix text is ##, for the above menu you would have to type "##sun " or "##mon ".
Use if you need a hot-key or other trigger before typing menu item text.
Assume you have this TS menu with 2 items (the "/b/i/c" sets options):
/b/i/c sun :'"Sunday" mon :'"Monday"
Assume its trigger is key F12. When you press F12 and type "sun", it replaces the text with "Sunday". When you press F12 and type "mon", replaces with "Monday".
Assume it's trigger is key `, and "Eat" is unchecked. When you type "`sun", it replaces the text with "Sunday". When you type "`mon", replaces with "Monday".
You should not use alphanumeric keys for trigger. Instead use text trigger. If using alpha keys and option /i (case insensitive), also set third state for Shift checkbox in Trigger tab.
QM 2.3.3. A TS menu cannot work if it doesn't have a trigger. If you want to use mac or other way to activate it, at first assign a trigger. It can be any trigger except text trigger. Also, a TS menu will not work if it or QM is disabled.
QM 2.3.3. All TS menus don't work if disabled in Options -> Triggers, regardless of trigger type.
TS menu text is a list of items, each in separate line. Item format:
text :statements
text - text that you must type to execute statements.
statements - any commands that you can use in macros.
Separator between text and statements is single space and colon ( :). For example, if trigger is key `, and menu contains line mail :"name@abc.com" (two spaces after "mail"), the command is executed when you type "`mail " (with space).
Lines that don't have : and don't begin with / are ignored and can be used for comments.
QM 2.3.3. Lines that begin with space are comments. If need space, use escape sequence [32].
Lines that begin with / are used to set options for following items (until next such line). To set options, you can use the Properties dialog. Options:
| /s | Select the typed text. Uses Shift+Left keys. |
| /b | Erase the typed text. Uses Backspace key.
|
| /i | Case insensitive. |
| /c | If first character of the typed text is uppercase, capitalize first character of the first paste or key.
|
| /m | QM 2.3.3. With confirmation. Shows a popup list (read below) containing single item. |
| /p1 | QM 2.3.3. Need a delimiter character (postfix) to execute an item.
|
| /p2 | QM 2.3.3. Need to press Ctrl to execute an item. |
| /p3 | QM 2.3.3. Need a delimiter or Ctrl to execute an item. |
This example sets "select text", "case insensitive" and "capitalize" options for items that follow:
/s/i/c
You can also add and remove options for each item separately. To remove, use uppercase characters. In this example, /C tells that "capitalize" option must not be used:
/C/ pw1 :"password1"
If you need / character at the beginning of item's text, use //.
QM 2.3.3. If multiple menu items match typed text, shows a popup list.
List item text is extracted from menu item code or comments. Example:
text :'"This will be list item text" text :'"zzzz" ;;This will be list item text
Keyboard shortcuts:
To show this for a single item, use option /m.
To prevent excuting a TS menu item, while typing its text (not before) do one of the following:
A TS menu item will not be executed if a non-delimiter character (alphanumeric + specified in Options -> Triggers) was typed previously, unless trigger is a key with "Eat". To execute anyway, before typing do one of the above (click, Ctrl, etc).
You can associate sounds with TS menu events: Options -> Sounds.
QM 2.3.3. Works in console windows.
QM 2.3.3. Removed 5 s timeout.
QM 2.3.3. Default opt keymark is 1. It makes more reliable. In called functions it is 0.
QM 2.3.3. You can use function TriggerInfoTsMenu to get user-typed text and other info about menu item.
Usually in TS menu items you use an "insert text" command. To insert text, can be used keyboard (key) or clipboard (paste). For short text it's better to use keyboard, because it does not erase clipboard, however it can be too slow with quite long text. For items where code is simple text in double quotes (like abc :"text"), QM uses clipboard or keyboard, depending on hybrid paste setting in Options -> General.
May interfere with other running keyboard/autotext software, or with similar features of the target program, eg Microsoft Word autocorrect.