- Filelocator pro containing text file how to#
- Filelocator pro containing text file archive#
- Filelocator pro containing text file windows#
Var strCustom = SearchParms.FilenameCustomParm For example, the isValidFileName script could use the Custom Parm value entered in the Scripting tab like this: Scripts can access almost all the other search criteria through the object 'SearchParms'. Note the use of two '\\' to represent a single '\' in 'C:\\Windows' since the backslash character is the special escape character in regular expressions. Var regExp = new RegExp( SearchParms.FilenameCustomParm )
using JScript's built in Regular Expression object.
An example of a NOT expression on a file's pathname
Filelocator pro containing text file how to#
Here's an example of how to implement a NOT when path name matching (the NOT expression to be matched is entered in the 'File name' CustomParm field on the Scripting tab):
Filelocator pro containing text file windows#
For example, to exclude the Windows directory from a search the NOT expression on the path is simply 'C:\\Windows'. Note how the regular expression object is created outside of the function body so that it is only created and compiled once for any given search, although it may be called many times.Īnother variation of the NOT expression (see above) is for excluding certain directories from a search. Var regExp = new RegExp( SearchParms.ContainingTextCustomParm ) įunction isValidLine( nLineNum, strText ) An example of a NOT expression, this time using JScript's built in Regular Expression object. Here's an example of how to implement NOT when contents matching using JScript's own regular expression engine (the NOT expression to be matched is entered in the 'Containing text' CustomParm field on the Scripting tab): If an exception occurs and is not caught by the script the search will stop.Īnother example shows how to locate only folders.īIsValid = objFSO.FolderExists( strPath + strFileName ) Note that try.catch blocks have been used to prevent exceptions being thrown back to the search engine. Var objFile = objFSO.GetFile( strPath + strFileName ) Var objFSO = new ActiveXObject( "Scripting.FileSystemObject" ) įunction isValidFileName( strPath, strFileName )
Filelocator pro containing text file archive#
use the '32' instead of '1' to find files with Archive attribute specified. Note: Other attributes could be used, e.g. The following example shows a sample file name script to limit the files returned to those that have the Read-Only attribute specified.
Note: Please see the "Sample Scripts" sub-folder of the FileLocator Pro's installation folder for some provided sample scripts. The functions should return a boolean true or false value to indicate if the file or line is valid or not.
file name or containing text expressions. Scripts are only called if the other search criteria is satisfied, i.e. If the script is a 'Containing text' script the function called is 'isValidLine' and is passed the line number and text as parameters.If the script is a 'File Name' script the function called is 'isValidFileName' and is passed the file path and name as parameters.Once the script is loaded FileLocator Pro will then call a specific function inside the script depending on the script type: Loads the script into the scripting engine.Creates the Active Scripting engine for each script as specified by the Prog Id entered in the 'Engine' field.When the user starts a search FileLocator Pro: FileLocator Pro supports Active Scripting to customize the search engine's file name and contents matching algorithms.