You can use the evaluator with filters (including the Find tool) in several ways:
The evaluation expression can be called in one of three modes:
The special variables subfolder and quick_filter tell you which mode the expression is being called for. Handling recurse mode (when subfolder is true) is optional - if the expression never queries the value of the subfolder value, Opus will simply recurse into all subfolders and won't call you in that mode again.
The variables available to the evaluator in this context are:
Variable | Type | Description |
---|---|---|
column name |
varies |
All the column keywords are available as variables in this evaluation context. Note that some keywords may use characters like a : that aren't valid in variable names - to access them, use the Val function. |
file_name |
string |
Returns the full name of the file the filter is being run for. This may be different from file which (as a column keyword), returns the value of the Name column (which e.g. may have file extensions hidden). |
filter_args |
string |
In quick filter mode, this returns the value of the argument string that follows the pre-defined filter name in the quick filter. For example a quick filter of ?bigfiles:5 would invoke a filter called "bigfiles", and (if it was an evaluation filter) pass it the value "5" in this variable. |
is_dir |
bool |
Returns true if the expression is being run for a folder, false if it's being run for a file. |
opt_anyword |
bool |
In quick filter mode, returns true if the "any word" option is enabled. |
opt_ignore |
bool |
In quick filter mode, returns true if the "ignore diacritics" option is enabled. |
opt_partial |
bool |
In quick filter mode, returns true if the "partial match" option is enabled. |
opt_regex |
bool |
In quick filter mode, returns true if the "regular expression" option is enabled. |
quick_filter |
bool |
Returns true if the expression is being called for a quick filter. |
subfolder |
bool |
Returns true if the expression is being called in recurse mode. |
The return value from the evaluation expression depends on the mode it was called in, although in all cases it must return a bool: