Formatted Text Block

Started by Darius1968, June 16, 2022, 09:46:15 PM

Previous topic - Next topic

Darius1968

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: 
<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: 
{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. 

Mario

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.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Darius1968