photools.com Community

BOARD ARCHIVE => IMatch 5 Scripting and Apps => Topic started by: unterwasserfoto_at on April 14, 2015, 09:25:15 PM

Title: Looking for a methode in the Category Class to search a particular Categorie
Post by: unterwasserfoto_at on April 14, 2015, 09:25:15 PM
is there any methode?

   Dim selectedfiles As Files
   Set selectedfiles = Application.GetFileWindow(imfwtCurrent).SelectedFiles

   Dim f As File
   Dim cats As Categories

   For Each f In selectedfiles

      Set cats = f. Categories(False,False)

      If cats.IsCategory ( "MY_CAT")   Then

      Or

      If f.IsCategory ("MY_CAT") Then
Title: Re: Looking for a methode in the Category Class to search a particular Categorie
Post by: Mario on April 15, 2015, 08:38:46 AM
If Not f.Categories.Item("@All|Colors|Red") Is Nothing Then
  Debug.Print "This file is in Colors|Red"
end if
Title: Re: Looking for a methode in the Category Class to search a particular Categorie
Post by: unterwasserfoto_at on April 15, 2015, 08:45:53 PM
great. ist realy easy....thx, mario

an now i look for a methode too selct only a group of categories.

set cats = f.categories.item("@All|MY_CAT")

for each c in cats
debug.print c.QualifiedName    'MY_CAT|Home

is there a way, or i do loop by all assign categories?

i will a fast script  ;)
Title: Re: Looking for a methode in the Category Class to search a particular Categorie
Post by: Mario on April 16, 2015, 07:19:44 PM
Just loop. Very fast.