photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: christian.mueller on October 20, 2021, 01:59:33 PM

Title: Sort keywords
Post by: christian.mueller on October 20, 2021, 01:59:33 PM
Hi,
In the File Window I display all the keywords of the file, using the variable {File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|replace:~;==, }
as shown in the post Fun With Custom File Window Layouts - photools.com.

My question: how can I sort the keywords alphabetically in that view, similarly as the alphabetical sorting option in the keyword panel?
Title: Re: Sort keywords
Post by: Mario on October 20, 2021, 03:47:13 PM
You cannot sort the contents of a variable.
Keywords are stored in metadata in the order in which they were added and this is the order in which the variable displays them.
Since many clients, services, agencies and libraries enforce a specific keyword order (more important keywords first), IMatch does not reorder or sort keywords.

Consider using a variable for the @Keywords categories instead. Like this one, which comes straight from the Variables (https://www.photools.com/help/imatch/#var_basics.htm) help topic (search for @Keywords on that page):

{File.Categories|filter:@Keywords;replace:~;=={cr}{lf}}
Title: Re: Sort keywords
Post by: christian.mueller on October 21, 2021, 07:18:43 PM
Thank you for the rapid answer :    {File.Categories|filter:@Keywords;replace:~;=={cr}{lf}} solved my formatting problem.