Search in Folders is a script command for Directory Opus, that simplifies searching for items within the selected folders whose names|description|tags,content match a user-defined pattern.
Its main features are:
- Since the command can be used in multiple places, the pattern can be defined textually, using the contents of the clipboard and even showing the user a prompt to enter text.
- The pattern can be composed of several entries, separated by a user-defined character (default is new line).
- Pattern can be typed, edited, readed from a text file or pasted from the clipboard in a multi line input string dialog window.
- Use wildcards and regular expressions in the pattern, compatible with the syntax used by DOpus.
- The command has arguments for case matching, regex usage, wildcard usage and partial matching.
- Optionally the results can include folders.
- Define the folders from which the search will be performed from the same command.
- Optionally, Everything can be used to perform the search.
- Aditionally, you can search for content, description or tags.
HOW TO INSTALL
Download the file below. Then run Prefs SCRIPTINSTALL
and select the downloaded file.
IMPORTANT: Needs at least v13.0.55
Search in Folders.opusscriptinstall (4.2 KB)
USAGE
You can use Search in Folders as an additional command, using SearchFolders
.
COMMAND ARGUMENTS
Argument | Type | Description |
---|---|---|
CASE | /S | Use for make the search case sensitive. |
EVERYTHING | /S | Use voidtools Everything to perform the search. Note that you can then use Everything's own syntax and search using values with or without wildcards, in a mixed manner. e.g. |
FOLDERS | /S | Use to include folders in the results. By default, the command searches for files only. |
IN | /K/M | By default the command will use the selected folders in source to search. Use IN for specify the folder or folders to search instead. Note that if the paths contain a space, you must enclose the value in quotes. |
NODIACRITICS | /S | Use to ignore diacritics. |
NOPARTIAL | /S | Use to prevent partial name matching. |
NORECURSE | /S | Use to prevent the search from extending into sub-folders. |
NOWILD | /S | Use to prevent wildcard name matching in regular search. Note that CASE, NOWILD, REGEX and NOPARTIAL affects all the values in pattern, so for example, you will not be able to mix values with wilcards and without them in the pattern.
e.g. |
PATTERN | /O /R | The value to be used as a pattern to search for. You can include several entries in a same pattern, each separated by SEP value. e.g. SEP=; PATTERN *.txt;*.xml;blah will search for all items whose name matches with *.txt, *.xml or blah. If PATTERN is included without value, or omitted from command line, text input is enabled from a dialog box, with multiline support, text file loading, and editing. Note that PATTERN is a raw value, means must be used at last, since the rest of the command line following the argument name is taken as the value. |
REGEX | /S | Enables regular expressions. |
SEP | /K | The value to be used as a separator for PATTERN, when several patterns are provided. If not included, the default separator will be Windows line break (\r\n). |
VALUE | /K | Use description, tags or content value when searching, instead of names. |
EXAMPLES
Search for all files containing "test" in their description in the source lister, excluding subfolders.
SearchFolders IN {sourcepath} VALUE=desc NORECURSE PATTERN test
Use clipboard content as pattern, which contain several lines:
SearchFolders PATTERN {clip}
Use a user defined string by a dialog as a pattern, separated by semicolon. Make the search case sensitive and include folders.
SearchFolders CASE FOLDERS SEP=; PATTERN {dlgstring|Pattern:}
Display a dialog box that allows you to load a text file with one filename per line, and then edit the loaded text.
SearchFolders
or SearchFolders PATTERN
Use Everything to search all jpg files in C:\my images and D:\my images.
SearchFolders IN "C:\my images" "D:\my images" EVERYTHING PATTERN ext:jpg
Use Everything to search all jpg files in C:\ and D:\ with a defined height (may require Everything v1.5)
SearchFolders IN C:\ D:\ EVERYTHING PATTERN ext:jpg height:{dlgstring|Height to search:}
CHANGELOG
v1.0.4 (2024-01-09)
- Added new arguments:
NODIACRITICS
,NORECURSE
andVALUE
. VALUE
argument allows search by tags, content or description instead of names.
Full changelog
v1.0.3 (2023-11-15):
- In a regular search, if a value from pattern contains *, NOWILD is ignored for that particular entry.
v1.0.2 (2023-11-14):
- Added IN argument to specify folders to search instead of selected.
- Added EVERYTHING argument to use Everything for searching.
v1.0.1 (2023-11-14):
- PATTERN is now an optional, raw type argument. If omitted or used by itself, it allows the pattern to be entered later in a multiline dialog box, with support for text files load and editing.
v1.0.0 (2023-11-13) : Initial release