Autotext lists are used to execute commands when you type certain text. Typical usage - text replacement/autocomplete/autocorrect. Also known as text-sensitive menu or TS menu.
An autotext list has no visible interface. When you type text somewhere, and the text matches one of list items, executes its command.
An autotext list works only if it has a trigger.
Added in QM 2.3.3.
Assume you have this autotext list 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 (hotkey etc) before typing text. It just makes the autotext list active. Other QM item types cannot have this trigger.
To assign this trigger, use the Properties dialog. You can set programs where the autotext list works, and a filter function (read more below). Also you can set prefix text; for example, if prefix text is ##, for the above example you would have to type "##sun " or "##mon ".
Use if you need a hotkey or other trigger before typing text.
Assume you have this autotext list 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. An autotext list 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, an autotext list will not work if it or QM is disabled.
QM 2.3.3. All autotext lists don't work if disabled in Options -> Triggers, regardless of trigger type.
Autotext list text is a list of items, each in separate line. Item format:
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 there is line `mail :"[email protected]" (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 .
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.|
Erase the typed text. Uses Backspace key.
|/m||QM 2.3.3. With confirmation. Shows a popup list (read below) containing single item.|
QM 2.3.3. Need a delimiter character (postfix) to execute an item.
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:
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 //.
It is possible to add some more options with a filter function. Filter functions allow you to define conditions where the autotext list (all or some items) will work. You can define a window, define a custom set of postfix characters, etc.
To get user-typed text and other info, you can use function TriggerInfoAutotext (QM 2.3.5) or TriggerInfoTsMenu (QM 2.3.3). The function can be used in autotext list filter functions and item code.
QM 2.3.5. You can use FFT_Autotext_PostfixCustom as a filter function example or template for autotext lists.
QM 2.3.3. If multiple items match typed text, shows a popup list.
The displayed popup list item text is extracted from list item code or comments. Example:
text :'"This will be popup list item text" text :'"zzzz" ;;This will be popup list item text
To show this for a single item, use option /m.
To prevent executing an autotext list item, while typing its text (not before) do one of the following:
An autotext list item will not be executed if previously typed character is non-delimiter (alphanumeric + specified in Options -> Triggers), unless trigger is a key with "Eat". To execute anyway, before typing do one of the above (click, Ctrl, etc). QM 2.3.5: previously typed character can be any if item text begins with a delimiter and trigger is autotext.
You can associate sounds with autotext list 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.
Usually in autotext list 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.