Can I create custom user variables and use them in file paths or snippets?
User variables can be of great help in various situations:
- network drive users having to enter long (and often cryptic) paths to reach their content can shorten these paths using convenient variable names;
- if you use a Shared menu of type Personal on two different computers sharing the same cloud drive (like Dropbox), user variables like
{Dropbox}
allow you to have fix favorites paths in your menu even if your cloud drive is at different locations on your two systems; - same thing for teams using shared menus and cloud drives; favorites in shared menus for folders or files on a cloud drive will work regardless the cloud drives location on each team member PCs;
- if you plan to move your files to another location, you can use a variable to avoid having to edit all the favorites after you moved the files to the new location;
- user variables can also be used in favorites name;
- etc.
To manage your user variables, select the menu Options, User Variables. In this tab, enter your user variables, one by line. Each line must start with the variable name between curly brackets (e.g. {MyVariable}
), followed by the equal sign =
and the variable content (e.g. {MyVariable}=My Content
).
The first time you launch QAP, it creates user variables for commonly used cloud drives found on the system: {Dropbox}, {OneDrive}, {GoogleDrive} and {iCloudDrive}.
You can add your own variables. For example, if one line contains {OurSharedFolder}=S:\ThisFolder
, the placeholder {OurSharedFolder} will be replaced by S:\ThisFolder in a favorite paths (and other location properties) when launching it or in snippet’s content when pasting it.
If you have multiple user variables, you can use text separators to make your list easier to read. Any lines not starting with { is treated as a comment.
In the following example, the user variable {OneDrive} is inserted in the favorite folder {OneDrive}\Project. If the variable contains C:\Users\Standard\OneDrive as in the previous example, the Project folder will be opened in C:\Users\Standard\OneDrive\Projects.
Notes
- Nesting user variables: User variables can be nested but remember that variables are resolved (or replaced) in the order they appear in the list. If
{Var2}
includes{Var1}
,{Var2}
must appear before{Var1}
in the list of variables. - Inserting a user variable “as-is” in a text snippet: precede the variable’s opening bracket with a backtick, eg.:
`{Dropbox}
.
See also: