Resource

Resource Basics

Resource Name Search for missing XMP property
Resource Version 1.0
Category Search Scripts
Downloads 907
Release Date 8/27/2020 11:14:23 AM
 

Resource Details

Description This script will search for missing XMP properties in the catalog. You can enter the name of the property manually
Installation Instructions Download the script to a folder on your local disk
Usage Instructions 1. Open Tools -> Scripter
2. Load the download script
3. Run the script by clicking the run button
4. Enter the XMP property to search for
5. The results will be displayed in a newly opened tab
Changes in this version n.a.
Special Requirements
 

Author Information

Author Name IDimager Support
 

Available Attachments

Attachment #1 Search for Missing XMP Property.png
 

Script

{
  This script will search for missing XMP properties in the catalog

  Version 1.0; 27 aug 2020 by IDimager
          Changes: Initial version
}
var
  AProperty: WideString;
  AMeta: TMetaSchemaItem;

  AGroup: TCatalogPropGroup;
  AResult: TCatalogItems;
begin
  AProperty := 'dc:title';
  AProperty := ReadFromRegistry('Scripts\FindWithoutXMP', 'PropertyName', AProperty);
  if not AskInput('Search for missing XMP property', 'XMP Property', '', AProperty, False, nil) then
    exit;
  WriteToRegistry('Scripts\FindWithoutXMP', 'PropertyName', AProperty);

  AGroup := TCatalogPropGroup.Create(nil);
  AResult := TCatalogItems.Create(TCatalogItem, '');
  try
    AMeta := AGroup.ExcludeMetaItems.Add;
    AMeta.MetaProperty := AProperty;
    AMeta.Caption := AMeta.MetaProperty;

    PublicCatalog.EnumGroupResultQuick(AGroup, AResult, -1);

    if AResult.Count > 0 then
    begin
      // display the results in a new tab
      AResult.Name := 'Search Script: Find Items Without ' + AProperty;
      PublicBroadCast(nil, 'OpenNewTab', nil);
      PublicBroadcastObject(nil, 'ShowImageResults', AResult, nil, nil);
    end
    else
      Say('No results');
  finally
    AResult.Free;
    AGroup.Free;
  end;
end;