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

The features described in this page require Quick Access Popup v9.2 or more recent.

You can insert values from placeholders (like {Clipboard}) in Snippets content and in favorite's Location, Parameters and Start In fields (for all types of favorites supporting these options). Placeholders contents are  based on:

  • the current content of your Windows Clipboard;
  • the favorite's own location;
  • the current folder in Windows Explorer.
  • the selected item in Windows Explorer folders and files list.

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 content of 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}\"" (the backslash "\" acts 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.

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 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 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 (a "root" client folder in our example).

Current location placeholder can be inserted in location for favorites of types Folder, Document and Application.

You call also use these placeholder variations:

  • {CUR_LOC} for full location
  • {CUR_NAME} for file name
  • {CUR_DIR} for directory
  • {CUR_EXT} for extension
  • {CUR_NOEXT} for file name without extension
  • and {CUR_DRIVE} for drive letter

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

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?.

Selected file or folder in 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 or the selected file in the current file manager window if you open the menu with the keyboard shortcut (Windows + W).

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:

  • {SEL_LOC} for full location
  • {SEL_NAME} for file name
  • {SEL_DIR} for directory
  • {SEL_EXT} for extension
  • {SEL_NOEXT} for file name without extension
  • and {SEL_DRIVE} for drive letter
Placeholders in Snippets

Since v9.2, placeholders can be inserted in Snippets content. Also, if you use the Prompt before pasting option, placeholders in the Snippet prompt will also be expanded with the content of the Clipboard or of one of the locations placeholders.

How can I enter multiple parameters for an application favorite?

In favorites advanced settings, you can enter command line parameters (also called arguments) that are added to the application path when the application is launched (more info on this). If you have only one parameter, simply type it in the field Parameters of the last tab of the Add/Edit Favorite dialog box. Usually, you would not need to enclose the parameter between double-quotes but this is something you could try if this does not work as expected.

You need to know that not all applications parse command-line parameters the same way. This is why some trial-error may be required. This is especially true if you want to enter more than one parameter. These parameters need to be separated by putting a space between them. But this may not be sufficient because spaces could be part of the parameters. The solution I found (based on my personal experience with a limited number of applications) is to enclose each parameter between double-quotes.

For example, if you want to launch Outlook with two parameters:

  • in Location (first tab) of an Application favorite, enter Outlook.exe (you don't need to enter the full path if the application is properly registered in your Windows environment);
  • in the last tab Advanced Settings, in Parameters, enter "/a c:\filename.txt" "/nopollmail" (double quotes around each parameter, one space between the two parameters).

This will launch Outlook without checking mail at startup ("/nopollmail") and will create a new mail item with the specified file attached ("/a c:\filename.txt").
(note: this parameter /nopollmail used as an example does not work anymore with recent versions of Outlook)

But remember that this technique is not universal and may require adjustments depending on the target application.