{
  This script will search for missing XMP properties in the catalog

  Version 1.0; 27 aug 2020 by H van Zwietering
          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;
