Consolodate SPLITLIST With FOREACH?

Started by Darius1968, October 29, 2023, 07:04:19 PM

Previous topic - Next topic

Darius1968

So far, in my File Window Tip, I've been able to get this desired output - out of 4 lines, separated with a plain line feed (Shift+Enter): 

FWT-Title.png
... using the following XAML and variable formatting: 

[b]{File.Categories.Direct|contains:TV Series,[/b]

[b]{File.MD.XMP::dc\title\Title\0|replace:{lf}==`;splitlist:`,first;prefix:FORMAT1;postfix:RUN SEPARATOR}[/b]
[b]{File.MD.XMP::dc\title\Title\0|replace:_Video|==;replace:{lf}==`;splitlist:`,1;prefix:FORMAT1; postfix:RUN SEPARATOR}[/b]
[b]{File.MD.XMP::dc\title\Title\0|replace:{lf}==`;splitlist:`,2;prefix:FORMAT1; postfix:RUN[/b]
[b]SEPARATOR[/b]
[b]{File.MD.XMP::dc\title\Title\0|replace:{lf}==`;splitlist:`,last;prefix:FORMAT1; postfix:RUN};[/b]

[b]pereplace:FORMAT1==<Run Foreground="#FFAA00" FontSize="24pt">;pereplace:RUN==</Run>;pereplace:SEPARATOR==<Run FontSize="36pt" Foreground="#2A50FF">֍</Run>}[/b]

So, the problem I'm now trying to solve is that of consolidation: 
How can I shorten the code for the lines in the middle, where I have splitlist: statements for indexes: first, 1, 2, last.  Instead, is it possible to somehow invoke foreach:  to have iteration over all of the indexed values, without the need to explicitly enumerate each one myself?  

Thanks