var ACatItem: TCatalogItem; i: Integer; ACommaText: WideString; ATokens: TTntStringList; AToken: WideString; AProps: TCatalogItemProps; AProp: TCatalogItemProp; AItems: TCatalogItems; begin if Selected.Count = 0 then Say('No image selected in the Collection Viewer') else begin ACommaText := ''; if not AskInput('Title', 'Comma list', 'enter a comma separated list of names to assign as catalog labels', ACommaText, False, nil) then exit; ATokens := TTntStringList.Create; AProps := TCatalogItemProps.Create(TCatalogItemProp, ''); AItems := TCatalogItems.Create(TCatalogItem, ''); Tokenize(ACommaText, ',', ATokens); for i := 0 to ATokens.Count - 1 do begin AToken := Trim(ATokens.Strings[i]); AProp := TCatalogItemProp.Create(nil); if not PublicCatalog.FindPropByName(AToken, AProp, '', True) then begin // store it now AProp.PropName := AToken; PublicCatalog.StorePropToDatabase(AProp, Catalog.KeywordsGUID, False); end; AProp.CopyTo(AProps, False); AProp.Free; end; for i := 0 to Selected.Count - 1 do begin ACatItem := TCatalogItem.Create(nil); if PublicCatalog.FindImageCombined(Selected.Items[i], ACatItem, 0, True) then begin ACatItem.CopyTo(AItems, False); end; ACatItem.Free; end; if Ask('Are you sure you want to assign ' + IntToStr(AProps.Count) + ' catalog label(s) ' + CrLf2 + AProps.PropList(CrLf) + CrLf2 + 'to ' + IntToStr(AItems.Count) + ' image(s)?') then begin PublicCatalog.StoreItemsToTempList(AItems, False); PublicCatalog.AddPropsToItemsInTempList(AItems, AProps); PublicCatalog.RemoveItemsFromTempList(AItems); end; AItems.Free; AProps.Free; ATokens.Free; end; end;