home *** CD-ROM | disk | FTP | other *** search
- !!script
- // Copyright ⌐ 1997-1998 - Modelworks Software
- // @Created by Roger Gouin 12/20/98
- // @Modified by Roger Gouin 12/21/98
- // @Modified build 247 cm19981228
-
- /**
- @Tool: findFiles~lists files matching the search parameters. The
- search parameters can include '*' and '?' and ';'. The '*' matches
- any number of characters, the '?' matches any one character and the
- ';' starts a new search expression.
- @EndTool:
- @Summary: findFiles~lists files matching the search parameters
- */
-
- var gOutput = getOutput();
-
- function DoCommand()
- {
- gOutput.clear();
-
- var directory = chooseDirectory("Find file: Select a directory to search");
- if (directory == null) return;
-
- var findExpression = prompt("Find file: Enter search expression with wild cards",
- "*.*");
-
- if (findExpression == "") return;
-
- var fileList = getDirectoryFiles(directory, findExpression, true);
- if (fileList == null) return;
-
- gOutput.writeLine(
- "Find files matching \"" + findExpression + "\"\n");
-
- var count = 0;
- var position = fileList.getHeadPosition();
- while (position && position.valid)
- {
- count++;
- var file = fileList.getNext(position);
- // Use the writeMessage method to make the output "double-clickable"
- gOutput.writeMessage(file.path, 0, "");
- }
-
- gOutput.writeLine("\n------ " + count + " file(s) found-----");
- gOutput.writeLine("End of find files list");
- }
-
-
- !!/script
-
-