Resource

Resource Basics

Resource Name Search for Partial Folder Name
Resource Version 1.0
Category Catalog
Downloads 877
Release Date 1/29/2014 12:36:37 AM
 

Resource Details

Description This Photo Supreme script allows you to search on partial folder names.
Installation Instructions Download the script to a temporary folder
Usage Instructions 1. Open Tools -> Scripter
2. Load the downloaded script
3. Run the script
Changes in this version n.a.
Special Requirements
 

Author Information

Author Name IDimager Support
 

Script

{
	Version 1.0
	Author: Stefan / IDimager
}
var
  ACatItems: TCatalogItems;
  ADm: TDBXOMClientDataSet;
  AFolder: WideString;
begin
   AFolder := ReadFromRegistry('Scripts\SearchFolder', 'LastName', '');
   if not AskName ('Enter the folder to search for', 'Folder Name', AFolder, True, False, nil) then
     exit;
   WriteToRegistry('Scripts\SearchFolder', 'LastName', AFolder);
   ACatItems := TCatalogItems.Create(TCatalogItem, '');
   try
     ACatItems.Name := 'Search for Folder Name: ' + AFolder;
     ACatItems.LastSort      := ActiveCollection.LastSort;
     ACatItems.LastSortOrder := ActiveCollection.LastSortOrder;

     ADm := Catalog.NewDataSet;
     ADm.CommandText := 'SELECT  ' + Catalog.FullColumnList('i.') + ' ' +
                        'FROM    v_CatalogItem i, idFilePath fp ' +
                        'WHERE   fp.GUID = i.PathGUID ' +
                        'AND     fp.Filepath like ''%' + AFolder + '%'' ' +
                        '';
     ADm.OpenSet;
     ACatItems.AddDataSet(ADm, cKeepDatasetOpen);
     PublicBroadcastObject(nil, 'ShowImageResults', ACatItems, nil, nil);
     Catalog.FreeDataSet(ADm);
   finally
       ACatItems.Free;
   end;
 end;