photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: DigPeter on December 24, 2021, 07:28:04 PM

Title: Problem with metadata templates
Post by: DigPeter on December 24, 2021, 07:28:04 PM
I am using latest IM 2021 version.  For the first time since upgrading to 2021 I have been using some metadata templates which worked for me in IM 2020.  Littorals (text, space, '()'  ) are written correctly, but variables are not now written.  Has something been changed in the new version?

This is the short question.  I can send more detail, including debug file if required.

Happy Christmas - froeliche Weinacht
Title: Re: Problem with metadata templates
Post by: Mario on December 24, 2021, 07:38:25 PM
Not in the lab right now. Gave MT temples a quick test on my tablet. No problems. e.g. "Add year to keywords" or "Set Object Name / Title from file name". All use variables and work just fine.
No other user has reported anything similar. Tip: Try your variables in VarToy.
Title: Re: Problem with metadata templates
Post by: DigPeter on December 28, 2021, 07:12:06 PM
Thanks Mario
The problem seems to apply to variables involving filtering on level:leaf

I attach files of some images, associated metadata templates and log file. 

Reading the variables help, I see filter is now preceded with '^'.  I have IM 2020 still installed on anther computer and the template in the attachment work there, so there seems to have been a change of syntax in IM 2021.
Title: Re: Problem with metadata templates
Post by: DigPeter on December 28, 2021, 07:43:19 PM
The attachment "Leaf ^filter.jpg" demonstrates results using leaf variables in IM 2021.  ^filter does seem to work.
Title: Re: Problem with metadata templates
Post by: Mario on December 28, 2021, 07:49:12 PM
^filter just disables the filter. Where did you read this? I cannot find it anywhere.

filter:^bla is a valid expression, meaning starting with bla

There is also a pending change for the next release related to category filters, see note #1606 at https://www.photools.com/release-notes/
This sounds like it is related.
Title: Re: Problem with metadata templates
Post by: DigPeter on December 28, 2021, 08:44:36 PM
Quote from: Mario on December 28, 2021, 07:49:12 PM
^filter just disables the filter. Where did you read this? I cannot find it anywhere.
See example "File.Categories|filter:RegExp" in Variables help.

Title: Re: Problem with metadata templates
Post by: Mario on December 28, 2021, 08:47:18 PM
I'm probably overlooking something...

I see many (valid) examples using filter:^... but no ^filter:...
Title: Re: Problem with metadata templates
Post by: DigPeter on December 29, 2021, 01:58:28 PM
Quote from: Mario on December 28, 2021, 08:47:18 PM
I'm probably overlooking something...

I see many (valid) examples using filter:^... but no ^filter:...
Sorry Mario - I must be boss-eyed!

Attachment "VarToy" show the results of several expressions.  None of them produce the required leaf "Small Tortoiseshell".  The first expression includes ^Taxa and returns a blank!
Title: Re: Problem with metadata templates
Post by: Mario on December 29, 2021, 02:53:15 PM
The release notes say:

If you combine filter and level with category variables, the filter was always applied to the selected level. This behavior has changed in this release (upcoming).

Now the order in which filter and level appear in the variable matters. If filter appears before level, the filter expression is applied to the entire category path, and the selected level is returned for all matching categories. If level appears before filter, the filter is applied only to the selected level.


Please export your categories and copy the variables you use in your MD template into a text file. Also add info about what outcome you were expecting.
ZIP and send to support email address (https://www.photools.com/support/) or attach to your reply.
Title: Re: Problem with metadata templates
Post by: thrinn on December 29, 2021, 03:21:22 PM
@DigPeter: In addition to what Mario says:
I guess you are not talking about "real" IMatch categories but about @Keyword? At least the screenshots you provide give a hint in this direction.
In this case, be careful when using a RegExp for "start with": Look at the following expression which will give you all @Keyword categories starting with the top level keyword "Taxa":

{File.Categories|filter:^@Keywords\|Taxa}
Unfortunately, you still have to wait for the upcoming release to be able to combine this with a level:leaf expression (see Mario's answer and the corresponding release note entry #01606).
Title: Re: Problem with metadata templates
Post by: DigPeter on December 29, 2021, 07:22:03 PM
@Thrinn

Many thanks.  Yes, I use @keywords almost exclusively.  The strange thing is that {File.Categories|filter:Taxa;level:leaf} works in IM2020
Title: Re: Problem with metadata templates
Post by: DigPeter on January 25, 2022, 12:48:33 PM
Just installed latest update, which went without a hitch as normal.  Delighted that this problem is now fixed.
Thanks Mario.