You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -18,6 +18,7 @@ This manual includes a description of the system functionalities and capabilitie
18
18
*[pattern attribute](#pattern-attribute)
19
19
*[exists attribute](#exists-attribute)
20
20
*[properties attribute](#properties-attribute)
21
+
*[exprtk attribute](#exprtk-attribute)
21
22
*[inverse attribute](#inverse-attribute)
22
23
*[Icons](#icons)
23
24
*[Actions](#actions)
@@ -385,6 +386,42 @@ See [properties](#properties) section for how to define custom properties.
385
386
386
387
387
388
389
+
### exprtk attribute: ###
390
+
391
+
The `exprtk` attribute validates a menu based on a string expression algorithm. The expression must be specified as a mathematical expression and the result must evaluates to `true` or `false` such as `4 == 5` or `10 > 3`.
392
+
393
+
If `exprtk` attribute is specified, the expression must evaluates to `true` for the validation to be successful. The `exprtk` attribute does not support multiple expressions but logical `and` and `or` operators can be use to group expressions.
394
+
395
+
If `exprtk` attribute is not specified, then the validation is successful.
Strings may be comprised of any combination of letters, digits special characters including (~!@#$%^&*()[]|=+ ,./?<>;:"``~_) or hexadecimal escaped sequences (eg: \0x30) and must be enclosed with single-quotes.
404
+
eg: `'Frankly my dear, \0x49 do n0t give a damn!'`
405
+
406
+
The `exprtk` attribute allows advanced menu validation. The following table show useful expression examples:
| Test a property for a numeric value | ${value} == 6 | Evaluates to true when property `value` is set to numeric value `6`. |
411
+
| Test a property for a string value. | '${name}' == 'John' | Evaluates to true when property `name` is set to string value `John`. |
412
+
| Set a menu visible based on how many file are selected | ${selection.count} == 3 | Evaluates to true when user clicked on exactly 3 elements. |
413
+
| Set a menu visible based on a state machine | '${myapp.state}' == 'PAUSED' | Evaluates to true when application's state is `PAUSED`. |
414
+
| Set a menu *invisible* when it was selected 3 times. | ${myapp.runs} <= 2 | Evaluates to true when property `myapp.runs` is lower or equals to `2`. |
415
+
| Set a menu visible by filename length. | '${selection.filename}'[] == 9 | Evaluates to true when user clicked on a file whose filename<br>(including file extension) is exactly 9 characters. |
416
+
| Combine expressions with `and` and `or` logic. | ${foo} == 2 or ${bar} >= 5 | Evaluates to true when property `foo` is set to `2`*or*<br>when property `bar` is set to a value greater or equal to `5`. |
417
+
| Set a menu visible if user selection contains a specific string. | 'abc' in '${selection.path}' | Evaluates to true when user clicked on a file that contains the string `abc`. |
418
+
| Set a menu visible if user selection matches a string pattern. | '${selection.path}' ilike '*.exe' | Evaluates to true when user clicked on a file with `exe` extension. |
419
+
420
+
**Note:**
421
+
The `exprtk` attribute uses the *exprtk library* to parse the expression. For more details and supported expressions, see the exprtk documentation on the [official github page](https://github.com/ArashPartow/exprtk) or the [library website](http://www.partow.net/programming/exprtk/index.html).
422
+
423
+
424
+
388
425
### inverse attribute: ###
389
426
390
427
The `inverse` attribute inverts the logic of one or multiple attributes. For example, to inverse the meaning of the `maxfiles` attribute, set `inverse` attribute to the value `maxfiles`.
@@ -931,6 +968,9 @@ The following table defines the list of dynamic properties and their utility:
931
968
| selection.filename.extension | Matches the file extension of the clicked element. |
932
969
| selection.drive.letter | Matches the drive letter of the clicked element. For example 'C'. |
933
970
| selection.drive.path | Matches the drive path of the clicked element. For example 'C:\'. |
971
+
| selection.count | Matches the number of clicked elements (files and directories). |
972
+
| selection.files.count | Matches the number of clicked files. |
973
+
| selection.directories.count | Matches the number of clicked directories. |
934
974
935
975
Selection-based properties are encoded in utf-8.
936
976
@@ -959,7 +999,9 @@ The system will generates the following property values (note the `\r\n` charact
Note that properties `selection.drive.letter` and `selection.drive.path` are empty when all selected files are from a network share.
1002
+
Notes:
1003
+
* Properties `selection.drive.letter` and `selection.drive.path` are empty when all selected files are from a network share.
1004
+
* Properties `selection.count`, `selection.files.count` and `selection.directories.count` are not multi-selection-based properties. They are defined as a single value whether a single or multiple elements are selected.
0 commit comments