Mythicsoft Knowledge Base

Full Text Search
»

Using the Search Engine with JScript

RSS
The FileLocator Pro core search engine can be used from within many late binding scripting environments, including JScript. This is a very simple script showing how to list all .txt files in the root of the C:\ drive.

var engineSearch = new ActiveXObject( "FLProCore.SearchEngine" );



engineSearch.SearchCriteria.FileName = "*.txt";
engineSearch.SearchCriteria.ContainingText = "";
engineSearch.SearchCriteria.SearchSubDirectory = false;
engineSearch.SearchCriteria.LookIn = "c:\\";
engineSearch.SearchCriteria.FileNameExprType = 4;        // DOS Expression

var listResult = engineSearch.Start(false);

for (n = 0; n < listResult.Count; ++n)
	WScript.Echo(listResult.Item(n).FileName);




More information on the Search Engine can be found here:

http://www.mythicsoft.com/filelocatorpro/sdkhelp/index.html

Mythicsoft KB powered by ScrewTurn Wiki. Some of the icons created by FamFamFam.