Problem with metadata templates

Started by DigPeter, December 24, 2021, 07:28:04 PM

Previous topic - Next topic

DigPeter

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

Mario

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.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

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.

DigPeter

The attachment "Leaf ^filter.jpg" demonstrates results using leaf variables in IM 2021.  ^filter does seem to work.

Mario

^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.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

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.


Mario

I'm probably overlooking something...

I see many (valid) examples using filter:^... but no ^filter:...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

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!

Mario

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 or attach to your reply.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

thrinn

@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}

  • Leaving out the @Keywords part would give you regular IMatch categories instead, starting with Taxa.
  • You have to escape the | with a backslash because | has a special meaning in RegExp.
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).
Thorsten
Win 10 / 64, IMatch 2018, IMA

DigPeter

@Thrinn

Many thanks.  Yes, I use @keywords almost exclusively.  The strange thing is that {File.Categories|filter:Taxa;level:leaf} works in IM2020

DigPeter

Just installed latest update, which went without a hitch as normal.  Delighted that this problem is now fixed.
Thanks Mario.