INTERACT FORUM
More => Old Versions => JRiver Media Center 18 for Windows => Topic started by: rossp on August 05, 2013, 04:58:49 am
-
Hi All, I am playing about with tagging images and playing slideshows. I was wondering what Caption expression you all use. Mine is below but does have some drawbacks.
[Caption] [Places] - (formatdate([date,0],dd MMMM yyyy))
[Keywords]
[People]
I do not have all tags filled for each image (who does) so the formatting is often off.
An example:
[Caption] = Uncle Toms Trail - Lower Falls
[Places] = Yellowstone
[Keywords] =
[People] = Ross Gail
Result
Uncle Toms Trail - Lower Falls Yellowstone - (28 June 2013)
Gail; Ross
It would be nice to have Keywords excluded as it is blank. People separated by a comma and a comma before Places (unless Places is blank).
Uncle Toms Trail - Lower Falls, Yellowstone - (28 June 2013)
Gail, Ross
So I just wondered if any of you clever people have any magic expressions or advice on what you do to tag your images and view the info in a slideshow.
Ross
-
OK, with as a bit of playing around the following gets me:
[Caption] if(isempty([Places]),,/,[Places]) - (formatdate([date,0],dd MMMM yyyy))
[Keywords]
Replace([People],;,/,)
Uncle Toms Trail - Lower Falls ,Yellowstone - (28 June 2013)
Gail, Ross
but I still can't get rid of the blank line ;(
-
Every physical line in a caption or thumbnail text expression outputs a corresponding line in the caption or thumbnail.
That said, I don't see how your caption above could produce 3 lines.
-
Edited the original post, missed the [Keywords] out.
-
This is a better caption expression as it keeps all the info on one line.
[Caption]if(isempty([Places]),,/, [Places]) if(isempty([People]),,/ [replace([People],;,/,)]) - (formatdate([date,0],dd MMMM yyyy))
eg
[Caption] = Uncle Toms Trail - Lower Falls
[Places] = Yellowstone
[People] = Ross Gail
output
Uncle Toms Trail - Lower Falls, Yellowstone [Gail, Ross] - (28 June 2013)
Ross
-
If you're going to use a single line, you might want to avoid extraneous separator characters when items are empty. Treat each segment as an item in a list, each separated by some separator character. ListBuild() helps accomplish this by outputting the separator sequence in between non-empty items.
So you have 2 items separated by ", ", and one of those items is a list separated by " " and the other by " - ". This means you need 3 listbuilds(). The delimit() function can handle adding the brackets/parens around people/date when people/date is not empty.
listbuild(1, /,/ ,[Caption], listbuild(1, / -/ , listbuild(1, / , [Places], replace(delimit([People], ], [),;,/,)),delimit(formatdate([date,0],dd MMMM yyyy), /), /()))
and that breaks down to:
listbuild(1, /,/ ,
[Caption],
listbuild(1, / -/ ,
listbuild(1, / , [Places], replace(delimit([People], ], [),;,/,)),
delimit(formatdate([date,0],dd MMMM yyyy), /), /()))
-
Hi MrC,
With yours I get
Uncle Toms Trail - Lower Falls, [Gail, Ross] - (28 June 2013)
when [Places] is empty. With mine the comma is omitted.
Uncle Toms Trail - Lower Falls [Gail, Ross] - (28 June 2013)
That is why I used the isempty statement, I could use delimit around [Places] I suppose.
Ross
-
It wasn't clear to me when the separators should be output. The expression was just an example of how to omit unwanted separators.
Try yours with an empty Caption but non-empty Places.
-
Yes I see what you mean Master. I will try to modify yours to get the best result. Thanks for the tip.
Ross
-
Please share what you come up with!
-
OK I think I have it (although I did modify mine with your lovely delimit function MrC),
if(isempty([Places]),[Caption],delimit([Caption],/,,)) [Places] if(isempty([People]),,/ [replace([People],;,/,)]) - (formatdate([date,0],dd MMMM yyyy))
This will output:
Uncle Toms Trail - Lower Falls, Yellowstone [Gail, Ross] - (28 June 2013)
Uncle Toms Trail - Lower Falls [Gail, Ross] - (28 June 2013)
Uncle Toms Trail - Lower Falls - (28 June 2013)
(28 June 2013)
depending on what [Caption] [Places] and [People] have as values.
Most complicated expression I have made (with help of course)
Ross
-
Thanks for sharing.
I love building simple expressions, I really struggle to follow these longer ones
eg your:
[replace([People],;,/,)]
-
If [People] = Ross; Gail
then [replace([People],;,/,)]
will result in
[Ross, Gail]
or replace([People],;,/,)
will result in
Ross, Gail
Hope that helps
Ross
-
A nice trick, by the way, if you want to build lists like these, and reduce the number of ListBuild() operations, is to use the same delimiter throughout. If you can live with that, you're done. If not, then you can Replace() them if necessary, from left to right.
Instead of:
A, B - C
you create
A:::B:::C
and fix up the ::: separators in this order:
A, B:::C
A, B - C
This introduces the simpler (for most folks) Replace() command instead of the extra surrounding ListBuild(). Or, if the lists are of known length, Regex() can replace the ::: separators in one shot. Just some additional ways to do it.