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.

Can I insert values in favorites path, parameters or snippets using LOCATION placeholders?

You can insert values from placeholders in Snippets content and in favorite’s Location, Parameters, Launch with and Start In fields (for all types of favorites supporting these options). When inserted in your favorites, placeholders can be replaced with locations or part of these locations (like folder, filename or drive) based on:

See also:
Can I insert values in favorites properties using dynamic or interactive placeholders?
Debugging placeholders and user variables.

Favorite’s location

In an Application favorite, you can re-use the favorite’s location (or part of it) in the Start In or the Parameters fields. For example {DIR} in the the Start In field will be replaced with the favorite’s location folder. The following examples are based on the favorite’s location C:\MyFolder\MyFile.exe:

  • {LOC} for full location (C:\MyFolder\MyFile.exe)
  • {NAME} for file name (MyFile.exe)
  • {DIR} for directory (C:\MyFolder)
  • {EXT} for extension (exe)
  • {NOEXT} for file name without extension (MyFile)
  • and {DRIVE} for drive letter. (C:)

In the following example, an Application favorite named My App with data file will be open with a parameter based on the application’s folder.

The Parameters field below includes the {DIR} placeholder with a file name Client.DAT. The second red box shows that the {DIR} placeholder will be expanded taking into account the applications’ location from the above screen capture.

Multiple parameters can be inserted in this field. Each parameter must be enclosed between quotes. Also, do not forget that, even if there is only one parameter, a parameter must be enclosed between quotes if it contains spaces.

Current folder in Windows Explorer

You can also use the placeholders {CUR_LOC}, {CUR_DIR}, etc. that will be replaced with the current location of your Explorer window (window under the mouse pointer or active Explorer window when you open the menu). Let’s say you have various folders with the same subfolders structure, for example:

C:\Client-1
C:\Client-1\Contract
C:\Client-1\Contract\Draft
C:\Client-1\Contract\Signed
C:\Client-2
C:\Client-2\Contract
C:\Client-2\Contract\Draft
C:\Client-2\Contract\Signed
etc.

You can create favorites of type Folder or Document that will be opened in a given subfolder under the current (or active) folder in Windows Explorer. For example, a favorite Folder named Current Client’s Signed Contract would open the Signed subfolder for Client-1 if you are in the C:\Client-1 folder, or for the second client if you are in C:\Client-2, etc.

Create a favorite folder with the Folder (path) {CUR_LOC}\Contract\Signed in the Basic Settings tab:

When you will launch this favorite, QAP will get the current folder (in Windows Explorer, Directory Opus or Total Commander) and will replace the placeholder {CUR_LOC} with the detected current folder’s location. To avoid “folder not found” errors, make sure you have a strictly constant subfolders structure and that you always use this favorite in the appropriate folder.

Current (or active) folder in Windows Explorer placeholder can be inserted in location for favorites of types Folder, Document and Application. You can also use these placeholder variations. The following examples are based on the current (or active) folder location C:\Parent\Child:

  • {CUR_LOC} for full location (C:\Parent\Child)
  • {CUR_NAME} for file name (Child)
  • {CUR_DIR} for directory (C:\Parent)
  • {CUR_EXT} for extension (empty)
  • {CUR_NOEXT} for file name without extension (Child)
  • and {CUR_DRIVE} for drive letter (C:)

In situations where QAP could not detect the current folder in Windows Explorer (for example, if the active window is not Explorer), QAP can use a fallback folder if specified like this: {CUR_...|fallback_value}. For example:

  • {CUR_LOC|c:\Parent\Fallback\}
  • {CUR_NAME|Fallback_Child}
  • {CUR_DRIVE|F:}

See also this page for more info about the Start In and Parameters settings: Can I pass the current folder as parameter to an application launched with QAP?.

Note-1: Remember that, in QAP, the relative path conventions .\ for current folder or ..\ for parent folder are processed relatively to QAP’s Settings Folder, not to the current directory in your Explorer window.

Note-2: The current location cannot be detected by QAP for some dynamic folders or libraries (like Music or Videos). For example,  the Desktop folder is a dynamic folder combining the content from the user’s Desktop (C:\Users\UserName\Desktop) and from the Common Desktop (C:\Users\Public\Desktop). In this case, QAP detects that the current folder is the Desktop but, because it can’t distinguish between these two dynamic sources, it will always use the C:\Users\UserName\Desktop as current location since it is the most frequently used folder.

Selected file or folder in Windows Explorer

Similar to using the context menu with Right-Click but with much more flexibility, you can use QAP to pass the location of the selected file (or part of it) to a given favorite application or script.

In the following example, when launching the application favorite MyApp, QAP will replace  the {SEL_NAME} placeholder in the Parameters zone with the file name of the item under the mouse pointer when you open the QAP menu with the Middle Mouse Button.  If you open the QAP menu with the keyboard shortcut (Windows + W), the placeholder will be replaced with the name of the selected file in the active file manager window.

Open the QAP menu by pressing the Middle Mouse Button while the mouse pointer is over the desired file and launch the favorite. In the following example, the favorite application is showing a dialog box with, as parameter, the name of the selected file quickaccesspopup-9_1_2.zip.

These placeholders work in Windows Explorer and Directory Opus. They are not available in Total Commander at this time.

Available placeholders for the selected file are (examples are based on a selected file C:\Parent\Child\Name.Ext):

  • {SEL_LOC} for full location (C:\Parent\Child\Name.Ext)
  • {SEL_NAME} for file name (Name.ext)
  • {SEL_DIR} for directory (C:\Parent\Child)
  • {SEL_EXT} for extension (Ext)
  • {SEL_NOEXT} for file name without extension (Name)
  • and {SEL_DRIVE} for drive letter (C:)

Quick Access Popup Settings file

For user of Quick Access Popup with portable installation, the {SETTINGS_…} placeholders are replaced with the location of the quickaccesspopup.ini file in its working directory. Using the relative path special characters .. (parent directory) and \ (root directory) can also give access to the QAP working directory. However, these placeholders allow to use parts of this path, for example {SETTINGS_DRIVE} to designate the drive where QAP is running.

  • {SETTINGS_LOC} for full location (C:\Parent\Child\Name.Ext)
  • {SETTINGS_NAME} for file name (Name.ext)
  • {SETTINGS_DIR} for directory (C:\Parent\Child)
  • {SETTINGS_EXT} for extension (Ext)
  • {SETTINGS_NOEXT} for file name without extension (Name)
  • and {SETTINGS_DRIVE} for drive letter (C:)

Active window

Thanks to the placeholder {ActiveWindow}, you can open Documents, Links and FTP favorites in the active window. Simply insert the placeholder {ActiveWindow} in the Launch with this application property of the favorite in the Advanced Settings tab. To be the “active window”, an application must be at the foreground and, generally, have the keyboard or mouse focus.

For example, if you have Notepad and Notepad++ text editors running at the same time on your system, if you select in your QAP menu a text file favorite with this option, it will be open the editor that is currently the “active window”. The same is true for Link favorites and if you have two different browsers (like Chrome and Firefox) running at the same time on your system.

To open the favorite with the active window, QAP is using the Windows Run command using the active application path with the favorite’s path as parameter. Most of the time, the application will open the document in a new tab or a new internal window. However, in some case (for example with Notepad), the document will be open in a new instance (a new window) of the same application.

At this time, for safety, before launching a favorite, QAP displays a confirmation prompt with the path of the active widow. An option could be added in the future to bypass this prompt. If you need it, please raise this issue on the QAP forum.

Can I insert values in favorites properties using DYNAMIC or INTERACTIVE placeholders?

You can insert values from placeholders in Snippets content and in favorite’s Location, Parameters, Launch with and Start In fields (for all types of favorites supporting these options). When inserted in your favorites, placeholders can be replaced with text based on:

See also:
How can I use placeholders in favorites location, parameters, snippet text, etc.?
Debugging placeholders and user variables
Placeholders in favorites name

Clipboard

You can use the Windows Clipboard to insert variable pieces of text in your snippets or in various paths in favorites dialog box. When you launch your favorite, QAP automatically replaces the placeholder “{Clipboard}” (without the quotes) with the current text in the Windows Clipboard.

For example, in the following Snippet example, the Clipboard’s content will be inserted in the second line between the arrows. If the Clipboard contains an image or binary data, nothing is inserted.

In this second example, the content of the clipboard is sent as parameter. The content of the Parameters zone is expanded in the preview zone named Current parameters with expanded placeholders at the bottom of the dialog box. It shows what would be the parameter sent to the application with the current Clipboard’s content.

The example above is a working example for browsers applications Chrome, Firefox and Internet Explorer. This parameter will automatically launch your browser to search for the text contained in your Windows Clipboard. Make sure you include the quotes correctly to include all word in the search. If you want to search for an exact expression, add surrounding quotes like this: "? \"{Clipboard}\"" (these browsers consider the backslash “\” as an escape character for quotes inside the parameter).

If you use the browser Microsoft Edge, simply enter in the Parameters zone {Clipboard} (no quotes) for a normal search or "{Clipboard}" (with quotes) to search for an expression.

Text selected

Starting with QAP v11.6.3, you can use the placeholder {SelectedText} that will be replaced with the text selected in the active window. This can also be selected contents in other formats than plain text, for example cells in a spreadsheet, as long as a text-only version of this content is copied to the Clipboard by the active application. This cannot be an image.

See the Clipboard section above for similar example of usage of the {SelectedText} placeholder.

Note: Some applications may not react as expected when QAP tries to copy the selected text. If the copy does not succeed, the placeholder is simply deleted.

User Input

Using the placeholder {Input:prompt} you can enter a different content at each launch of a snippet or favorite.

The prompt inside the parameter will be displayed as a prompt in the input box, In the example below, QAP will open the folder c:\clients\ABC123.

The content entered by the user can be re-used in the same favorite thanks to a temporary user variable named based on the prompt of the Input placeholder. For example, in a Snippet with a placeholder {Input:Enter Client ID}, a temporary user variable named {Enter client ID} would allow to paste the ID of the client again later in the same snippet.

Using the placeholder {Menu:prompt} you can select a different item from a menu each time you launch a snippet or a favorite. The basic syntax for this placeholder is: {Menu:text1|text2|text3}. In this example, the text from the menu label (text1, text2, etc.) will be inserted in your favorite.

If you have long or multiline menu items, each item can be preceded with a shorter label using the tilde (~) as separator. For example: {Menu:label1~long or multiline text|label2~another item|…}. For better readability in the Edit favorite dialog box, the labels can include line breaks and tabs that will not be displayed in the menu.

Finally, you can make the first menu item bold to look like a title by starting the menu with an empty item with only a label. For example: {Menu:Title~|item label 1~item content 1|…}, as in this example:

Artist: {Menu:
Artists ~|
LD     ~Leonardo DiCaprio|
TC     ~Tom Cruise|
AS     ~Arnold Schwarzenegger}.
 

Current date or time

The placeholder {Now:format} inserts in favorite’s location or in a snippet the date or time at the moment the favorite is launched. The date and/or time is inserted following the syntax described in the AHK FormatTime command, for example:

  • {Now:yyyy-MM-dd} -> 2022-03-13
  • {Now:dddd hh:mm} -> Sunday 14:06
  • {Now:MMMM d, yyyy h:mm tt} -> March 13, 2022 4:30 PM

In addition to the AHK format the format {Now:ld} allows to insert the last day of the current month. You can combine this with other {Now:...} placeholders to form a complete date, for example:

  • {Now:ld} -> 28, 29, 30 or 31 depending on the current month
  • {Now:MMMM} {Now:ld}, {Now:yyyy} -> February 28, 2022

These placeholders can be inserted in locations, for example:

C:\reports\{Now:yyyyMM} for the folder of the current month (as in C:\reports\202203)

or in Snippets, for example:

Report sent on {Now:MMMM d, yyyy} at {Now:hh:mm tt}

Add UTC at the end of the format string to insert Universal Coordinated Time, for example: Report sent at {Now:h:mm UTC} UTC

Date and time calculation

You can also insert future or past dates and time using calculation with the following syntax:

  • {Now[sign][value pairs]:[format]}
  • where [sign] is either + (plus) or - (minus);
  • [value pairs] is one or more pairs of:
    • a number (integer);
    • a time unit identified by one of the letters smhdMy (case sensitive) for seconds, minutes, hours, days, Months or years;
  • and [format] is the date or time format as described above.

For example (supposing we are March, 13, 2022 at 4h30 PM):

  • {Now+1d:yyyy-MM-dd} (tomorrow)-> 2022-03-14
  • {Now-1y6M:yyyy-MM-dd} (1.5 year ago) -> 2020-09-13
  • {Now+3h30m:h:mm tt} (in 3.5 hour from now) -> 8:00 PM (or else, depending on regional settings)
  • {Now-1M:yyyy-MM}-{Now-1M:ld} (last day of previous month) -> 2022-02-28
  • {Now-30d:yyyy-MM-dd} (30 days ago) -> 2022-02-11
  • {Now+1M10d:yyyy-MM-dd} (in 1 month and 10 days) -> 2022-04-23
  • {Now-7h35m:HH:mm} time 7 hours and 35 minutes ago, in 24-hour format -> 08:55

Random text or number

The {RandomText:...} and {RandomNumber:...} are replaced by a random piece of text or number (integer or floating number) each time you launch a snippet or favorite.

  • {RandomText:text1|text2|text3} is replaced with one of the three pieces of text (for example, {RandomText:Today|Tomorrow|One of these days})
  • {RandomNumber:x|y} is replaced with an integer number between integers x and y (for example, {RandomNumber:5|10})
  • {RandomNumber:x|y|n} is replaced with a floating point number between x and y with n decimals (for example, {RandomNumber:0.5|1.49|2}

GUID (Globally Unique ID)

The placeholder {GUID} placeholder is replaced with a different Globally Unique ID of 32 hex digits (128-bit) each time you use a favorite.

Placeholders in favorites name

Some placeholders can be inserted in favorites name. The most obvious usage is to insert a date in your menu. {NOW:…} will be replaced the date and time when the menu is built (or refreshed).

These placeholders can also be used if whenever someone finds a usage for this:

  • {LOC}, {NAME}, etc. the favorite’s own location
  • {SETTINGS_LOC}, {SETTINGS_NAME}, etc. the location of your Quick Access Popup settings file;
  • {Clipboard}: content of the Clipboard when the menu is built
  • {Input:prompt} and {Menu:prompt}: prompting user each time the menu is refreshed
  • {RandomText:…} and {RandomNumber:…}, {GUID}: different at each refresh.

The other placeholders {CUR_…}, {SEL_…} and {ActiveWindow} are not applicable in the case of favorites names and will be replaced by an empty string. In all cases, if the resulting name is not unique, the suffix “[!]” will be added to the duplicate.

How can I debug placeholders and user variables?

You can test the effect of your placeholders and user variables in your favorites by enabling the Favorite debugging for placeholders and user variables in Options, Various Advanced Options tab.

When this option is enabled, an additional checkbox will be available in the Add/Edit Favorite dialog box Basic Settings tab allowing to enable debugging for this favorite.

When this option is enabled, instead of launching the favorite, QAP will display a dialog box containing the location (with parameter and Start in folder if applicable) expanded with the content of the placeholders and user variables. Disable the debug option to use your favorite.

What are snippets? How can I use them to paste frequently used pieces of text?

The favorites of type “Snippet” allow to send pieces of text or keystrokes to the active application using the QAP popup menu, hotstrings or keyboard shortcut. There are two types of snippets:

  • Text snippets
  • Macro snippets

Text snippet
By default, snippets are of type Text containing characters, end-of-lines and tabs. When you select a text snippet (in the popup menu, by typing its hotstring or by hitting its shortcut), its 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).

See:

Macro snippet

The second type of snippet, Macro, is for users with some experience with scripting language. Instead of pasting the snippet to a text box or editor, QAP sends its content to the active application as keystrokes that you would type at the keyboard. Macro snippets support the AHK special characters allowing to send special keystrokes like BackspaceHomeControl, etc.

See:

Hotstrings
A powerful way to paste or launch snippets is to trigger them using a shortcode called a hotstring.
See:

 

 

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.

How do I create a macro Snippet to send special keys to applications or insert pauses when pasting?

The Macro snippets are for users with some experience with scripting language. To create a macro snippet, open the snippet’s Advanced Settings tab in the Add/Edit favorite dialog box and select Macro mode. In this mode, instead of pasting the snippet, QAP sends its content to the active application as keystrokes that you would type at the keyboard.

Special keys and commands

Macro snippets support the special keys (defined by scripting language AutoHotkey) allowing to send special keystrokes like Backspace, Home, Control, etc. These special keys are always enclosed between curly brackets, for example: {Backspace}.

In addition, QAP offers some special commands for macro snippets:

  • {&Sleep:n} or {&n}: pause sending the snippet for n milliseconds (see AHK Sleep documentation)
    For example: {&Sleep:1000} or {&1000} to insert a one second pause while sending the snippet
  • {&SetKeyDelay:n, option}: slow down the execution of the snippet (see AHK SetKeyDelay documentation)
    For example: {&SetKeyDelay:50} to insert a 50 ms delay between each keystroke in the snippet
  • {&KeyWait:keyname, options}: pause sending the snippet until user press the specified key (see AHK KeyWait documentation, option D is set by default, additional option B available to sound “Beep” when snippet is suspended)
    For example: {&KeyWait:Space,B} to stop the macro snippet execution, sound “beep” and wait until user pushes down the space bar
Macro Snippet Working Example

Here is a full working macro snippet example. This macro snippet will launch Notepad, beep and wait for the space bar keypress, type some text, wait for the Shift keypress, add some text and open the Notepad Save dialog box:

{&SetKeyDelay:50}#r{&500}notepad{Enter}{&KeyWait:Space,B}
{Backspace}You are in Notepad{!}
Choose a location to save this file...{&500}^s

 

  • {&SetKeyDelay:50} : slow down the snippet execution with a 50 ms delay between each keystroke
  • #r : press Windows + R to open the Windows Run dialog box
  • {&500} : insert an half-second pause
  • notepad{Enter} : type notepad and press Enter to launch Notepad
  • {&KeyWait:Space,B} : beep and wait for the space bar keypress
  • You are in Notepad : type this text
  • {!} : type the exclamation mark (enclosed because “!” is an AHK special character, see AHK doc)
  • Choose a location to save this file… : type this text
  • {&500} : wait for another half-second
  • ^s : press Control + S to open the Notepad Save dialog box

Placeholders in macro snippets: 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?

Prompt before launching the macro snippet: In the Advanced Settings tab, you can enter text in Prompt before launching the snippet that will be displayed with a prompt to hit Enter or Space to launch the snippet, or Esc to cancel it. The prompt can include placeholders.

Macro programming experience is strongly recommended before using this feature. If you need help writing AHK macro, I recommend searching answers or asking question in the “Ask for help” section of the AHK forum where you will find plenty of knowledgeable people who love helping new macro programmers. You can also learn it with these books.

Can I insert command from the AHK programming language in a snippet of type macro? A QAP macro snippet favorite can send pieces of text and basic commands to your keyboard using the SendInput AHK command. However, it is not the place for full-fledge AHK macro language. Variables, conditional expressions (if), loops, etc. are not supported in macro snippet. But you can easily write an AutoHotkey macro using a text editor, save it in a file with .ahk extension and launch your AHK macro from QAP. To do this, create a QAP favorite of type Application and enter the location of your script (for example c:\AHKscripts\myscript.ahk) in the Application (path and file name).

See also:

What keys can be sent using Macro Snippets?

The following table lists the keys that can be inserted in Snippets of type Macro (each key name must be enclosed in braces). See: How do I create a macro Snippet to send special keys to applications or insert pauses when pasting?

These keys are defined by the scripting language AutoHotkey (AHK). See more info about AHK at the end of the page.

These special keys are always enclosed between curly brackets, for example {Backspace}. For this reason, as explained in AutoHotkey documentation, if whenever you need to enter opening or closing curly brackets in your snippet, you will have to enclose them that way: {{} and {}}.

Key Modifiers

The modifiers !+^# affect only the very next key. To send the corresponding modifier key on its own, enclose the key name in braces. To just press (hold down) or release the key, follow the key name with the word “down” or “up” as shown below.

Symbol Key Press Release Examples
! {Alt} {Alt down} {Alt up} !a presses Alt+A
+ {Shift} {Shift down} {Shift up} +abC sends the text “AbC”
!+a presses Alt+Shift+A
^ {Ctrl} {Ctrl down} {Ctrl up} ^{Home} presses Control+Home
# {LWin}
{RWin}
{LWin down}
{RWin down}
{LWin up}
{RWin up}
#e holds down the Windows key and then presses the E key
Symbol Meaning
{ } Braces are used to enclose key names and other options, and to send special characters literally. For example, {Tab} is the Tab key and {!} is a literal exclamation mark.

Note: As capital letters are produced by sending the Shift key, A produces a different effect in some programs than a. For example, !A presses Alt+Shift+A and !a presses Alt+A. If in doubt, use lowercase.

Special Keys

 Key  
{F1} – {F24} Function keys. For example: {F12} is the F12 key.
{!} !
{#} #
{+} +
{^} ^
{{} {
{}} }
{Enter} Enter key on the main keyboard
{Escape} or {Esc} Escape
{Space} Space (this is only needed for spaces that appear either at the beginning or the end of the string to be sent — ones in the middle can be literal spaces)
{Tab} Tab
{Backspace} or {BS} Backspace
{Delete} or {Del} Delete
{Insert} or {Ins} Insert
{Up} (up arrow) key on main keyboard
{Down} (down arrow) key on main keyboard
{Left} (left arrow) key on main keyboard
{Right} (right arrow) key on main keyboard
{Home} Home key on main keyboard
{End} End key on main keyboard
{PgUp} PageUp key on main keyboard
{PgDn} PageDown key on main keyboard
   
{CapsLock} CapsLock
{ScrollLock} ScrollLock
{NumLock} NumLock
   
{Control} or {Ctrl} Control
{LControl} or {LCtrl} Left Control key
{RControl} or {RCtrl} Right Control key
{Control down} or {Ctrl down} Holds the Control key down until {Ctrl up} is sent. To hold down the left or right key instead, use {RCtrl down} and {RCtrl up}.
   
{Alt} Alt
{LAlt} Left Alt key
{RAlt} Right Alt key (or AltGr, depending on keyboard layout)
{Alt down} Holds the Alt key down until {Alt up} is sent. To hold down the left or right key instead, use {RAlt down} and {RAlt up}.
   
{Shift} Shift
{LShift} Left Shift key
{RShift} Right Shift key
{Shift down} Holds the Shift key down until {Shift up} is sent. To hold down the left or right key instead, use {RShift down} and {RShift up}.
   
{LWin} Left Win key
{RWin} Right Win key
{LWin down} Holds the left Win key down until {LWin up} is sent
{RWin down} Holds the right Win key down until {RWin up} is sent
   
{AppsKey} Menu key (invokes the right-click or context menu)
{Sleep} Sleep key.
{ASC nnnnn} Sends an Alt+nnnnn keypad combination, which can be used to generate special characters that don’t exist on the keyboard. To generate ASCII characters, specify a number between 1 and 255. To generate ANSI characters (standard in most languages), specify a number between 128 and 255, but precede it with a leading zero, e.g. {Asc 0133}.

Unicode characters may be generated by specifying a number between 256 and 65535 (without a leading zero). However, this is not supported by all applications. For alternatives, see the virtual key and scan code below.

{vkXX}
{scYYY}
{vkXXscYYY}
Sends a keystroke that has virtual key XX and scan code YYY. For example: Send {vkFFsc159}. If the sc or vk portion is omitted, the most appropriate value is sent in its place.

 

   
{Numpad0} – {Numpad9} Numpad digit keys (as seen when NumLock is ON). For example: {Numpad5} is 5.
{NumpadDot} . (numpad period) (as seen when NumLock is ON).
{NumpadEnter} Enter key on keypad
{NumpadMult} * (numpad multiplication)
{NumpadDiv} / (numpad division)
{NumpadAdd} + (numpad addition)
{NumpadSub} - (numpad subtraction)
   
{NumpadDel} Delete key on keypad (this key and the following Numpad keys are used when NumLock is OFF)
{NumpadIns} Insert key on keypad
{NumpadClear} Clear key on keypad (usually the ‘5’ key when NumLock is OFF).
{NumpadUp} (up arrow) key on keypad
{NumpadDown} (down arrow) key on keypad
{NumpadLeft} (left arrow) on keypad
{NumpadRight} (right arrow) key on keypad
{NumpadHome} Home key on keypad
{NumpadEnd} End key on keypad
{NumpadPgUp} PageUp key on keypad
{NumpadPgDn} PageDown key on keypad
   
{Browser_Back} Select the browser “back” button
{Browser_Forward} Select the browser “forward” button
{Browser_Refresh} Select the browser “refresh” button
{Browser_Stop} Select the browser “stop” button
{Browser_Search} Select the browser “search” button
{Browser_Favorites} Select the browser “favorites” button
{Browser_Home} Launch the browser and go to the home page
{Volume_Mute} Mute/unmute the master volume.
{Volume_Down} Reduce the master volume.
{Volume_Up} Increase the master volume.
{Media_Next} Select next track in media player
{Media_Prev} Select previous track in media player
{Media_Stop} Stop media player
{Media_Play_Pause} Play/pause media player
{Launch_Mail} Launch the email application
{Launch_Media} Launch media player
{Launch_App1} Launch user app1
{Launch_App2} Launch user app2
   
{PrintScreen} Print Screen
{CtrlBreak} Ctrl+break
{Pause} Pause

About AutoHotkey

These keys are defined by the scripting language AutoHotkey (AHK) used to develop Quick Access Popup. In QAP Macro Snippets, these keys are sent using the AHK command Send in Input mode. If the command SetKeyDelay is used in a macro snippet, the mode is changed to Event to allow the delay.

See also: How do I create a macro Snippet to send special keys to applications or insert pauses when pasting?

[Tips] Launch your browser to search for the text or URL in your clipboard

In this tip, you will make two favorites work together inside a group. When a group of favorites is selected in the menu, its favorites are launched sequentially. In this example, the first favorite will launch you preferred browser and the second one will paste the content of your clipboard to launch a search (with Google or Bing, for example, as configured in your browser).  This tip will also show you how to assign a keyboard shortcut to a group.

Note: Since v9.2, QAP allows to put the content of the Clipboard as a parameter for Application favorites using the {Clipboard} placeholder. The example in that page shows how to search for the clipboard using this placeholder. However, the tip in this page has the advantage of allowing to search for text in the Clipboard OR to open the URL in the Clipboard. Also, it shows you how a group and a little macro snippet can increase the possibilities of QAP.

Read more

[Tips] Filling a web form using Snippets

See here the video tutorial Joe Glines and I did to illustrate this tip.

You have tedious web forms to fill every day or every week? Some smart forms and browsers will memorize all or part of the info you entered in a previous session. But what if not? Lets make some fun out of it and fill your web form in a snap with Quick Access Popup!

In this tutorial, you will learn how to

  • create a Snippet of type Macro;
  • enter the instructions to fill the form automatically;
  • launch your snippet to fill the form in one click in the QAP menu.

Read more