BOARD ARCHIVE => IMatch 5 Scripting and Apps => Script Gallery => Topic started by: rgdudley on November 07, 2016, 07:59:47 PM

Title: last leaf of category to keyword script?
Post by: rgdudley on November 07, 2016, 07:59:47 PM
I know that I have used this script before within imatch 5, but I can't seem to find how I did it.

I would like to take the last element of my hierarchical categories, in a given set of images, and insert the last element (leaf) as a keyword for those same images.

I have looked at the script "F-P Cats to hierarchical keywords" but this seems to require that you specify the category string to be converted.  What I am fairly sure I did before was to just select the images which had the categories already specified and the script would give me the leaf end of that category as a keyword.   

Just can't seem to find that script again since I updated my match(?) and changed to a new computer as well.

Thanks for your help

Title: Re: last leaf of category to keyword script?
Post by: Mario on November 07, 2016, 08:32:50 PM
Why not just use a Metadata Template?
For example, the variable


returns the lead keyword(s) of the file.
You can use that to add keywords to your files.

Note: If you fiddle with keywords on that level, make sure you don't create repetitive keywords.
Many of the "old" patterns, scripts and stuff no longer work for good reasons. They are no longer needed.

IMatch maps hierarchical keywords to flat XMP and IPTC (optional) keywords. And depending on your settings, a keyword like location|country|Germany may be flattened to
already. Make sure you understand how keywords are mapped between hierarchical and flat keywords before you start manually adding parts of your hierarchical keywords as flat keywords.

Also check out group levels and ignore levels in the thesaurus. They control if and how IMatch flattens keywords as well.