Author Topic: Formatted Text Block  (Read 151 times)

Darius1968

  • Hero Member
  • ***
  • Posts: 996
  • ---Darius
Formatted Text Block
« on: June 16, 2022, 09:46:15 PM »
I'm trying to use one of the ten fields available in the File Window Tip to output the file's keywords - each on its own line, in white text, all in a box with a blue background. 

So far, I've successfully come up with this: 
Code: [Select]
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Left" Background="#3f637e" Padding="2,2,2,2" Foreground="#ffffff" FontSize="7pt">{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|replace:~;==XXX;pereplace:XXX==<LineBreak/>}</TextBlock>...Which I'd be perfectly happy with, if it didn't take up space in the presence of files without keywords. 

To try to be more efficient and consolidated, inserting its presence only if a file does indeed have keywords, I have come up with this: 
Code: [Select]
{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|hasvalue:TEXT{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|replace:~;==XXX}BLOCK;default:;pereplace:TEXT==<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Left" Background="#3f637e" Padding="2,2,2,2" Foreground="#ffffff" FontSize="7pt">;pereplace:XXX==<LineBreak/>;pereplace:BLOCK==</TextBlock>}...Problem is I can't get the keywords to enumerate - one by one, each on its own line.  How can my last example be modified to achieve my desired goal...  Thanks. 
« Last Edit: June 16, 2022, 09:50:32 PM by Darius1968 »

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31554
Re: Formatted Text Block
« Reply #1 on: June 19, 2022, 09:41:12 AM »
This is because of a glitch in the variable parser, triggered by nesting variables with escaped parameter separators ; using ~ inside another variable.
The separator escape ~ is removed while the outer variable is parsed and then is no longer available when the replace in side the nested variable is evaluated to replace:==XXX.
This has been resolved for the next regular IMatch update.


Darius1968

  • Hero Member
  • ***
  • Posts: 996
  • ---Darius
Re: Formatted Text Block
« Reply #2 on: June 19, 2022, 07:37:38 PM »
Thanks!