Resource

Resource Basics

Resource Name Filter With Exactly Two People Labels
Resource Version 1.0
Category Filter Script
Downloads 974
Release Date 4/11/2018 2:11:36 PM
 

Resource Details

Description This script will filter and return only images that have exactly 2 catalog labels assigned in the People Category.
Installation Instructions 1. Download the script to your hard drive
2. Store the script in the "appdata\Scripts\FilterScripts" folder. Create it if it doesn't exist yet.
Usage Instructions 1. Select a set of images
2. Click the FILTER button
3. Select Filter With Exactly Two People Labels
Changes in this version n.a.
Special Requirements
 

Author Information

Author Name IDimager Support
 

Script

const
  cNumberCount = 2;

function Filter(AItem: TImageItem): Boolean;
var
  AProps: TCatalogItemProps;
  ACatItem: TCatalogItem;
begin
  result := False;

  ACatItem := TCatalogItem.Create(nil);
  if PublicCatalog.FindItemCombinedByGUID(AItem.GUID, ACatItem) then
  begin
    AProps := TCatalogItemProps.Create(TCatalogItemProp, '');
    PublicCatalog.EnumPropsInParentForItem(ACatItem, PeopleGUID, AProps, True, True, True, True, -1);
    result := (AProps.Count = cNumberCount);
    AProps.Free;
  end;
  ACatItem.Free;
end;