What are hotstrings?

“Hotstrings are a very useful new feature. Its much easier to remember short alias strings for snippets compared to a lot of hotkeys.”  

Horst

Using hotstrings is a powerful way to launch your favorites.

An hotstring is a shortcode or small sequence of keys that automatically triggers a QAP favorite (as a keyboard shortcut would do). The most common action for an hotstring is to replace an abbreviation (also called trigger) with the full content of a Text Snippet favorite.

For example, if you set “adr#” as an hotstring for a Text Snippet containing your full address, when, in any window, you type “adr#” plus Space or Enter, the trigger “adr#” is automatically deleted and your full address is typed as a replacement. This works in the active window of any application. In my example, the hash (“#”) symbols at the end of the hotstring is my personal way to make sure the hotstring trigger would not appear in the normal text I could type.

Hotstrings can also launch any type of favorites (folders, documents, applications, etc.). With some creativity, users could find efficient ways to use hotstring for any kind of favorites, or even some funny ways, for example, play a gentle sound when you type your sweetheart’s name. Hotstring can even open a submenu of your QAP menu or launch a group of favorites.

Using hotstrings

Since hotstrings are generally used with Snippet favorites, add a favorite of type Snippet or edit an existing Snippet favorite. In the Content text zone of the Basic Settings tab, type what will be sent as replacement text for this hotstring. Remember that you will also be able to send this content to the active window by selecting the favorite in the popup menu or by assigning a keyboard shortcut to this favorite.

To set an hotstring, open the Edit Favorite dialog box and select the Menu Options tab. Then, click the Change button beside Hotstring (trigger and options).

In the Change hotstring dialog box, set the trigger and its options. Any character (letters, numbers or symbols) can be used as trigger.

You can also assign an hotstring to a new snippet using the Snippet Quick Add QAP feature.  See: Can I create a Snippet using the Clipboard and define its Hotstring in one step?

Due to large number of options combinations (taking into account its case-sensitivity and other options), QAP does not validate that the hotstring triggers are unique. In case of duplication, depending on various options, only one hotstring will be triggered. Checkbox options are described below.

When an hotstring is added to a favorite, its trigger will be displayed in the popup menu after the favorite name. This reminder is displayed (or not) according to the Hotkey and Hotstring reminders option in the Menu Appearance tab of the Options window.

The favorites hotstrings are also displayed in the Customize main window, under the Hotkey column, after the keyboard shortcut if there is one.

 

Managing hotstrings

You can review all your hotstrings at once in the Manage Hotkeys dialog box. Select the ToolsHotstrings menu in the Customize window. This will take you the Hotstrings tab in the Manage Hotkeys dialog box (you can change tab at the top to edit keyboard Shortcuts if you wish). Double-click on a favorite to edit its hotstring. If you want to add hotstrings to other favorites, first click the See all favorites checkbox (lower-left) to display favorites without hotstring and double-click the favorite to edit.

 

Hotstrings options

Various options can be configured for each hotstrings. These are for specific needs and may be left with their default unchecked values.

  • Case sensitive: When you type a trigger, it must exactly match the case defined in the favorite.
  • Expand inside other words: The hotstring will be triggered even when it is inside another word; that is, when the character typed immediately before it is alphanumeric. For example, with an hotstring trigger “al” for the Text Snippet “airline”, typing “practical ” would produce “practicairline “.
  • Keep hotstring abbreviation: Normally, automatic backspacing erases the abbreviation you type. You can stop it with this option in case your trigger is the beginning of your content and you need to keep it.
  • Do not wait for Ending key: Normally, an ending character is required to trigger an hotstring. Ending characters are: SpaceEnterTab and the keys - ( ) ' : ; " / , . ? ! [ ] { } \. With this option, you will not need to type an ending key. For example, the abbreviation adr# would be replaced (or would launch its associated favorite) the moment you type the # character.
  • Omit the ending character when pasting snippets (with QAP v11.1 or more recent): As mentioned above, typing an ending character like dot (.), comma (,) and the others listed above triggers the pasting of a text snippet. This ending character is restored after the trigger is replaced with the snippet’s content. Use this option if you prefer not to restore this character.

Default hotstring options

If you always use the same options for your hotstrings (for example, I always use the Do not wait for Ending key option), you can set them in the Options window, Snippets and Hotstrings tab.

These default options will only be used for new hotstrings. They will not impact existing hotstrings.

If, like me, you always end the triggers with a specific character to make them unique (“#” in my case because, on my French Canadian keyboard, this key is easily accessible), you can set the option Do not wait for Ending key as default and the last character of your trigger (“#”) will immediately launch the replacement or the favorite.

Tip: Users reported that starting an hotstring trigger with a comma (,), for example ,adr is a convenient way to make a trigger unique since, in normal writing, the comma is always followed by a space.

How do I create a Text Snippet and paste it when I need it?

Snippets are pieces of text that you can paste into the active application using the QAP popup menu, hotstrings or shortcuts. Text snippets can contain characters, end-of-lines, and tabs.

Creating a snippet

  1. In the Customize window, click the Add button and select the type Snippet.
  2. In the Add Favorite dialog box, give the snippet a name for the menu and enter the text in the Content text box. In this text box, pressing Enter will add an end-of-line and pressing Ctrl + Tab will enter a tab.

  3. If the content does not fit in the Content text zone, you can expand the text box to make editing easier by clicking the + sign. When the content is expanded (as below), use the sign to return to normal display. You can also display the snippet content in fixed font and choose the font size.

  4. In the Menu Options tab, select the parent menu and item position as for other type of favorites. Before saving, you will find it helpful to set a Shortcut or an Hotstring for your snippet. Click one of the two Change buttons (you could set both options if you wish) and set the shortcut or the hotstring as illustrated below.

    In these examples, the selected shortcut (left side) is Shift + Control + H and the hotstring trigger (right side) is #html# (TIP: for hotstrings, use “#” or any other symbol to make the hotstring trigger unique).

  5. In the Advanced Settings tab, you can enter text in Prompt before pasting the snippet that will be displayed with a prompt to hit Enter or Space to paste the favorite, or Esc to cancel it. The prompt can include placeholders (see the tips and tricks, below).
  6. Finally, click Add to save the favorite snippet.

You can also add a Snippet using the content of the Windows Clipboard. See Can I create a Snippet using the Clipboard and define its Hotstring in one step?

Pasting snippets

You can paste snippets in three ways (as for other types of favorites) but the first one is particularly useful for snippets. First, select the keyboard insertion point in a text zone of the active window. Then, paste the snippet using one of these techniques:

  1. If you defined an hotstring (as in the example above, on the right), type the hotstring trigger, in our example: #html# and press Enter or Space. As you press the termination key, the hotstring trigger is replaced (or “expanded”) with the content of the snippet. Voilà !
  2. If you defined a shortcut (as the left example above), hit the shortcut key, in our example Shift+Control+H. The snippet is immediately pasted at the keyboard insertion point in the targeted window.
  3. Or open the popup menu and select the snippet. It will be pasted at the keyboard insertion point in the targeted window.

The snippet’s content is sent to the active application at the current insertion point as you would do using the Windows Clipboard Paste command. Although, the content of the Clipboard is not impacted by this action.

Snippets tips and tricks

  • If you open the popup menu by clicking the QAP icon in the Notification zone (Windows Tray), middle-clicking in the task bar or the Desktop, the active window loses the focus (become inactive) when the popup menu is open. In order to paste its content, QAP will ask you to activate the window where you want to send the snippet. QAP will display a message asking you to select the target window and hit the Enter key when you are done. You have up to 10 seconds to select the target application, set the keyboard insertion point and press Enter.
  • When trying to paste a snippet from the popup menu, some application or control (text area) may lose focus when the QAP menu is popped up making it impossible to paste the snippet in the active window. Pasting a snippet to the Explorer address bar is one example. An alternative is to assign a hotstring trigger or a keyboard shortcut to the snippet (Edit Favorite, in Menu Options tab). When invoked from a hotstring or a keyboard hotkey, the focus stays in the active window.
  • You can use the Windows Clipboard, user input or the current date-time to insert variable pieces of text in your snippets. For example, when you launch your favorite, QAP automatically replaces the placeholder {Clipboard} with the current content of the Windows Clipboard. Placeholders can also be replaced with various file locations. See Can I insert values in favorites location, parameters or snippets using placeholders?
  • When a snippet is edited with the Automatically encode end-of-lines checked, the snippet is saved to the settings file (quickaccesspopup.ini) with end-of-lines and tabs are automatically converted to symbols `n  (new line) and `t  (tab). Backtick characters (accent grave) are saved as double-backtick (` `). If you prefer to encode these characters yourselves, uncheck the check box.
  • When pasting the content of a snippet to the active window, QAP inserts three small safety delays. By default, the total duration of these delays is 300 ms (3/10th of a second). If your system is quick enough, you can try to reduce these delays (40 ms, 80 ms and 180 ms) in the Options windowVarious Advanced Options tab.

See also:

Can I create a Snippet using the Clipboard and define its Hotstring in one step?

The Snippet Quick Add QAP Feature combines the creation of a Snippet and its Hotstring in one dialog box. And it uses the content of Windows Clipboard to suggest a title and a text for your new Snippet. Click the Change button to assign an hotstring to your snippet.

To add the Snippet Quick Add feature to a menu, select Add Favorite, choose the type QAP Feature, section QAP Menu Editing and select Snippet Quick Add.