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:)

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.