Added positive versions of negative modifiers:
These make it easier to express a positive condition directly, instead of having to think in terms of a double negative.
@showif complements @hideif.
@enableif, @enableifpath, @enableiftab complement @disableif, @disableifpath, @disableiftab.
@ifsel complements @disablenosel.
@perfile: New modifier, changes the order multi-line commands execute on multiple files:
Affects commands that pass one file at a time, e.g. using {filepath$}.
Normally, each line in a command is run for all files before moving on to the next line. This makes sense sometimes, but not always.
With @perfile, you can specify a block of lines where the whole block runs for each file before moving on to the next file.
@perfile:begin marks the start of a block, and @perfile:end marks the end.
For example, with two files selected:
File Alpha.txt
File Bravo.txt
This command:
echo Line One -- {file$}
echo Line Two -- {file$}
Has this output:
Line One -- "File Alpha.txt"
Line One -- "File Bravo.txt"
Line Two -- "File Alpha.txt"
Line Two -- "File Bravo.txt"
While this command:
@perfile:begin
echo Line One -- {file$}
echo Line Two -- {file$}
@perfile:end
Has this output:
Line One -- "File Alpha.txt"
Line Two -- "File Alpha.txt"
Line One -- "File Bravo.txt"
Line Two -- "File Bravo.txt"
@logusage – New modifier, updates the system Recent list with any files passed to external programs, and the programs themselves.
@output – New modifier, outputs the rest of the line to the Sript Log from a normal command.
@if, and similar clauses, can now use Evaluator code to test various things:
Begin the condition with = to specify it is Evaluator code.
Variables selfiles, seldirs, selitems, return the number of selected items.
Variables totalfiles, totaldirs, totalitems return total number of items.
Variables source and dest return the source and destination paths.
Variables source_shell and dest_shell tell you if the source or destination are showing virtual Shell folders (e.g. Recycle Bin).
Variable viewmode returns the current file display mode.
In the viewer, variable selimage reports if part of the image is selected, and fullscreen if the viewer is fullscreen.
Evaluator code also has an IsSelected() function to test selections. Takes a wildcard pattern, optionally prefixed with "files:" or "dirs:", and returns the number of matching items.
IsChecked() and IsEnabled() can also be useful.
Example 1: Enable button only if there are exactly two .jpg files selected:
@enableif:=IsSelected("*.jpg") == 2
Example 2: Toggles between select-all and select-none:
@if:=(selitems==totalitems)
Select NONE
@if:else
Select ALL
Example 3: Alternative way to toggle between select-all and select-none:
Select {=selitems==totalitems ? "NONE" : "ALL"=}
@label – New modifier, uses Evaluator code to change a button's label dynamically.
Can use Evaluator functions and various variables, depending on context.
Variables include "dual" (true if a dual file display), "source" (source path), "dest" (destination path), "original_label" (the button's normal name, e.g. if you want to add to it instead of replace it entirely).
Example: @label=viewmode=="details" ? "Details Mode" : "Another Mode"
Button tooltips can change dynamically. See the Viewer toolbar's Edit > Copy for an example.
@hideblock – New modifier, allows one or more toolbar items to be hidden based on a condition.
In particular, this allows entire sub-menus to be hidden conditionally, which wasn't possible before.
It can also simplify hiding multiple buttons, since the condition can be defined once instead of in each button.
On the default toolbars, it's used to hide the redundant Favorites menu from the "File Display" toolbar if the new "Favorites Bar" toolbar is turned on.
Before the (potentially) hidden Favorites menu, there's a button which runs this:
@hideblock:begin
@hideif:Toolbar NAME="Favorites Bar" TOGGLE
That tests if the "Favorites Bar" toolbar is turned on, and starts hiding things if it is. After it is the sub-menu containing the Favorites list.
Finally, there's another button which stops hiding things:
@hideblock:end
Anything between the two buttons will be hidden if the first button's @hideif condition is met (or @showif condition is not met).
@disableiftab – New modifier, uses Evaluator code to disable items in the Folder Tab context menu, which is now customizable.
Variable sel gives the selected tab index (zero-based; -1 if the tab bar background is right-clicked).
Variable dual true if in a dual-display window.
Variable countdual gives number of tabs on the opposite side of a dual-display window.
Variable selr gives number of tabs to the right of the selected one.
Examples:
@disableiftab:sel == -1 – Disable if no tab is selected.
@disableiftab:sel > 1 – Disable unless the first or second tab is selected.
@disableiftab:selr == 0 – Disable if the rightmost tab is selected.
@disableiftab:(sel == -1) || dual – Disable if no tab selected, or in dual display.
Added @enableifpath:shell, @disableifpath:shell, etc. to test if the current folder is a virtual Shell namespace.
Default toolbars use this to disable the "Details + Thumbnails" button in Shell folders like Recycle Bin, where it won't work.
Can also use Evaluator with corresponding source_shell and dest_shell variables. E.g. @disableif:=source_shell
@eval and @evalalways – Runs Evaluator code as part of a dynamic test, and optionally as part of the command itself.
Typically used to set Evaluator variables which are used on later lines.
Example:
@eval:type = PathType(source);
fIsFileSystem = (type == "shell" || type == "filesys")
@showif:=fIsFileSystem
@label:fIsFileSystem ? ("Open " + FilePart(DisplayName(source)) + " in Explorer") : ("Disabled (" + type + ")")
Code after @eval: is only run when dynamically updating the button's label, visibility and enabled/disabled state. Not when the button is clicked.
Code after @evalalways: runs in both situations, allowing you to set up variables which are used both when executing commands and updating their labels, etc.
Evaluator code can also be inserted in the middle of normal command lines using the {=...=} syntax.
Evaluator code can also generate an entire command line, by starting the line with the = character.
@admin:no – Prevent subsequent lines from triggering UAC prompts. @admin:yes can be used to re-enable them.
@ifexists – You can specify a wildcard in the final path component, if the path is prefixed with wild:.
@icon:
Now allows quoted icon paths, fixing an issue with paths containing commas.
Can run Evaluator code instead of testing an internal command.
Can also use Evaluator to return an icon path directly.
@ctx – New modifier which allows Evaluator code to work with internal commands which generate a list of buttons.
The full manual will have more detail, but @ctx is very esoteric. Most people will never need to use or understand it.
It exists so we could make the new Favorites Bar display a named branch of the Favorites tree, where the name changes for different languages/locales.