Get current Portfolio Name or GUID?

Post Reply
mjbiggs
Posts: 10
Joined: 01 Oct 10 21:50

Get current Portfolio Name or GUID?

Post by mjbiggs » 02 Sep 20 16:23

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: 6330
Joined: 13 Sep 03 7:24

Re: Get current Portfolio Name or GUID?

Post by Hert » 03 Sep 20 8:55

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 which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

mjbiggs
Posts: 10
Joined: 01 Oct 10 21:50

Re: Get current Portfolio Name or GUID?

Post by mjbiggs » 03 Sep 20 9:32

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