Get current Portfolio Name or GUID?

Post Reply
mjbiggs
Posts: 22
Joined: 01 Oct 10 20:50

Get current Portfolio Name or GUID?

Post by mjbiggs »

Hello

Is it possible to get the name or GUID of the currently selected Portfolio/Gallery/Collection?
When viewing the 'Portfolios' tab, I would like to get this data whether or not image(s) are selected.
Hert
Posts: 7871
Joined: 13 Sep 03 6:24

Re: Get current Portfolio Name or GUID?

Post by Hert »

Keep in mind that in the Catalog Explorer you can select multiple entries with the Ctrl (Windows) or Cmd (macOS) key. And in the ALL section, you can even select multiple entries from different sections.
Here's what could help you to identify what is selected in the left side Catalog Tree:

Code: Select all

var
  ATxt: TTntStringList;
  AGroup: TCatalogPropGroup;
begin
  AGroup := SearchGroup;

  ATxt := TTntStringList.Create;
  try
    ATxt.Add('Selected Catalog Label Categories: ' + IntToStr(AGroup.IncludeCats.Count));
    ATxt.Add('Selected Catalog Labels: ' + IntToStr(AGroup.IncludeProps.Count));
    ATxt.Add('Selected Portfolios: ' + IntToStr(AGroup.Albums.Count));
    ATxt.Add('Selected Portfolio Collections: ' + IntToStr(AGroup.Collections.Count));
    ATxt.Add('Selected Folders: ' + IntToStr(AGroup.FilePaths.Count));
    ATxt.Add('Selected TimeLine: ' + IntToStr(AGroup.CatalogPeriods.Count));
    ATxt.Add('Selected Ratings: ' + IntToStr(AGroup.Ratings.Count));
    ATxt.Add('Selected Color Labels (per 2): ' + IntToStr(AGroup.Labels.Count));
    ATxt.Add('Selected File Types: ' + IntToStr(AGroup.FileTypes.Count));
    ATxt.Add('Selected States: ' + IntToStr(AGroup.States.Count));

    Say(ATxt.Text);
  finally
    ATxt.Free;
  end;
end;
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
mjbiggs
Posts: 22
Joined: 01 Oct 10 20:50

Re: Get current Portfolio Name or GUID?

Post by mjbiggs »

That's great. Exactly what I was after. I am now able to retrieve the name and GUID data I was seeking.
Many thanks. Regards
Mike
Post Reply