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
* feature-issue90:
* Fixed issue #90: New property for detecting empty directories. * Fixed issue #100: Visibility/Validity attribute istrue and isfalse for validation against boolean properties.
Implemented new properties `selection.dir.count` and `selection.dir.empty` for issue #90.
Copy file name to clipboardExpand all lines: UserManual.md
+75-25Lines changed: 75 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ This manual includes a description of the system functionalities and capabilitie
19
19
*[exists attribute](#exists-attribute)
20
20
*[properties attribute](#properties-attribute)
21
21
*[exprtk attribute](#exprtk-attribute)
22
+
*[istrue attribute](#istrue-attribute)
23
+
*[isfalse attribute](#isfalse-attribute)
22
24
*[inverse attribute](#inverse-attribute)
23
25
*[Combining multiple <visibility> and <validity> elements](#combining-multiple-visibility-and-validity-elements)
24
26
*[Icons](#icons)
@@ -445,6 +447,46 @@ The `exprtk` attribute uses the *exprtk library* to parse the expression. For mo
445
447
446
448
447
449
450
+
### istrue attribute: ###
451
+
452
+
The `istrue` attribute validates a menu if the specified value evaluates to *true*.
453
+
454
+
If `istrue` attribute is set, the application will evaluate the given value. If the value evaluates to *true*, the validation is successful. To specify multiple values, one must separate each value with the `;` character. If multiple values are specified, **all values** must evaluates to *true* for the validation to be successful.
455
+
456
+
If `istrue` attribute is not specified, then the validation is successful.
457
+
458
+
For example, the following set a menu visible only when the property `initialized` evaluates to *true*:
459
+
```xml
460
+
<visibilityistrue="${initialized}" />
461
+
```
462
+
463
+
The following values evaluates to *true* : `true`, `yes`, `ok`, `on` and `1`. The evaluation is case insensitive. All other values **does not** evaluates to true and will fail the validation.
464
+
465
+
For systems that are not configured in English, your system may use another value for *true*. For such system, ShellAnything has defined property `system.true` which allows one to set the property to the same value as `Yes` but in your system native language.
466
+
For example, you can set property `system.true` to `是的`, `sí`, `हां`, `sim`, `да`, `はい`, `oui` or `ja`.
467
+
468
+
469
+
470
+
### isfalse attribute: ###
471
+
472
+
The `isfalse` attribute validates a menu if the specified value evaluates to *false*.
473
+
474
+
If `isfalse` attribute is set, the application will evaluate the given value. If the value evaluates to *false*, the validation is successful. To specify multiple values, one must separate each value with the `;` character. If multiple values are specified, **all values** must evaluates to *false* for the validation to be successful.
475
+
476
+
If `isfalse` attribute is not specified, then the validation is successful.
477
+
478
+
For example, the following set a menu visible only when the property `initialized` evaluates to *false*:
479
+
```xml
480
+
<visibilityisfalse="${initialized}" />
481
+
```
482
+
483
+
The following values evaluates to *false* : `false`, `no`, `fail`, `off` and `0`. The evaluation is case insensitive. All other values **does not** evaluates to false and will fail the validation.
484
+
485
+
For systems that are not configured in English, your system may use another value for *false*. For such system, ShellAnything has defined property `system.false` which allows one to set the property to the same value as `No` but in your system native language.
486
+
For example, you can set property `system.false` to `不`, `नहीं`, `não`, `нет`, `いいえ`, `non` or `Nein`.
487
+
488
+
489
+
448
490
### inverse attribute: ###
449
491
450
492
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`.
@@ -464,6 +506,9 @@ The meaning of each inversed attribute in explained in the following table:
464
506
| pattern | Validates a menu if the selected file or directory **does not** match the wildcard pattern matching algorithm.<br>If multiple patterns are specified, **no pattern** must match the selected files for the validation to be successful. |
465
507
| exists | Validates a menu if the selected file or directory **does not** exists.<br>If multiple files/directories are specified, **all values** must _not exists_ on the system for the validation to be successful. |
466
508
| properties | Validates a menu if the specified property is **empty** or **not defined**.<br>If multiple properties are specified, **all properties** must be _empty_ or _not defined_ for the validation to be successful. |
509
+
| exprtk | Validates a menu if the given string expression **does not** evaluates to logical _true_.<br>If multiple expressions are specified, **no expression** must evaluate to logical _true_ for the validation to be successful. |
510
+
| istrue | Validates a menu if the given value **does not** evaluates to logical _true_.<br>If multiple values are specified, **no value** must evaluate to logical _true_ for the validation to be successful. |
511
+
| isfalse | Validates a menu if the given value **does not** evaluates to logical _false_.<br>If multiple values are specified, **no value** must evaluate to logical _false_ for the validation to be successful. |
467
512
468
513
Typical use case of the `inverse` attribute is about filtering out known file extensions.
469
514
@@ -512,7 +557,7 @@ The validity element should look like this:
512
557
513
558
Multiple <visibility> or <validity> elements can be added under a <menu> element. The logical `or` operator is used with each element of the same type. In other words, <visibility> elements are evaluated together and so are <validity> elements. This feature allows combining elements to achieve more complex validation.
514
559
515
-
For example, the following set a menu visible of if only a single file is selected ***or*** if only a single directory is selected:
560
+
For example, the following set a menu visible if only a single file is selected ***or*** if only a single directory is selected:
516
561
```xml
517
562
<visibilitymaxfiles="1"maxfolders="0" />
518
563
<visibilitymaxfiles="0"maxfolders="1" />
@@ -1070,26 +1115,36 @@ The application provides a list of dynamic properties. The values of these prope
1070
1115
1071
1116
The following table defines the list of dynamic properties and their utility:
| selection.path | Matches the full path of the clicked element. |
1121
+
| selection.dir | Matches the directory of the clicked element. When selecting a file, matches the directory of the clicked element. When selecting a directory, matches the path of the clicked element. |
1122
+
| selection.dir.count | Matches the number of files and directories in directory `selection.dir`. |
1123
+
| selection.dir.empty | Set to `true` when directory `selection.dir` is empty. Set to `false` otherwise. |
1124
+
| selection.filename | Matches the filename of the clicked element. |
1125
+
| selection.filename.noext | Matches the filename of the clicked element without the file extension. |
1126
+
| selection.parent.path | Matches the full path of the parent element. |
1127
+
| selection.parent.filename | Matches the filename of the parent element. |
1128
+
| selection.filename.extension | Matches the file extension of the clicked element. |
1129
+
| selection.drive.letter | Matches the drive letter of the clicked element. For example `C`. |
1130
+
| selection.drive.path | Matches the drive path of the clicked element. For example `C:\`. |
1131
+
| selection.count | Matches the number of clicked elements (files and directories). |
1132
+
| selection.files.count | Matches the number of clicked files. |
1133
+
| selection.directories.count | Matches the number of clicked directories. |
1134
+
| selection.mimetype | Matches the [MIME type](https://en.wikipedia.org/wiki/Media_type) of the selected file. [See below](#mime-types-general-description-and-charset) for examples. |
1135
+
| selection.description | Matches a general description of the file's content. See below for examples. |
1136
+
| selection.charset | Matches the [Character Set](https://www.w3schools.com/html/html_charset.asp) of the file. [See below](#mime-types-general-description-and-charset) for examples. |
1090
1137
1091
1138
Selection-based properties are encoded in utf-8.
1092
1139
1140
+
**Notes:**
1141
+
Properties `selection.drive.letter` and `selection.drive.path` are empty when user select files from a network share.
1142
+
1143
+
Properties `selection.dir.count` and `selection.dir.empty` are empty when multiple elements are selected.
1144
+
1145
+
The properties `selection.mimetype`, `selection.description` and `selection.mimetype` are based on the content of the selected file. The properties are provided by the *File* and *Libmagic* libraries to extract information about selected files. For more details, see the documentation at [github.com/Cirn09/file-windows](https://github.com/Cirn09/file-windows), [github.com/file/file](https://github.com/file/file) or the [official file documentation](http://www.darwinsys.com/file/).
1146
+
1147
+
1093
1148
### MIME types, general description and charset: ###
1094
1149
1095
1150
A MIME type is a label used to identify a type of data. It is used so software can know how to handle the data. It serves the same purpose on the Internet that file extensions do on Microsoft Windows. A MIME type is calculated from the actual content in a file.
@@ -1131,12 +1186,6 @@ Another option is to create your own *Configuration* and add the following menu
1131
1186
Press `CTRL+C` when the message is shown to copy the values to the clipboard.
1132
1187
1133
1188
1134
-
**Notes:**
1135
-
Properties `selection.drive.letter` and `selection.drive.path` are empty when user select files from a network share.
1136
-
1137
-
The properties `selection.mimetype`, `selection.description` and `selection.mimetype` are based on the content of the selected file. The properties are provided by the *File* and *Libmagic* libraries to extract information about selected files. For more details, see the documentation at [github.com/Cirn09/file-windows](https://github.com/Cirn09/file-windows), [github.com/file/file](https://github.com/file/file) or the [official file documentation](http://www.darwinsys.com/file/).
1138
-
1139
-
1140
1189
1141
1190
## Multi-selection-based properties ##
1142
1191
@@ -1160,8 +1209,9 @@ The system will generates the following property values (note the `\r\n` charact
* Properties `selection.drive.letter` and `selection.drive.path` are empty when all selected files are from a network share.
1214
+
* Properties `selection.dir.count` and `selection.dir.empty` are empty when multiple files are selected.
1165
1215
* 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