INTERACT FORUM
More => Old Versions => Media Jukebox => Topic started by: chrisjj on August 19, 2010, 11:20:17 pm
-
Can anyone tell me the expressions to provide the folder name and the parent folder name? E.g. from a filepath aaa/bbb/ccc.eee, provide bbb and aaa?
I find there is a field [Filename (name)] that provides ccc.eee bit I can find none for these folder names, nor any function to extract folder names from the filepath field.
Thanks.
-
For the following strings to work, you must be using MJ14 as MJ12 does not have the math capability.
You'll need to add a couple of custom fields to your library. They'll be calculated fields, and the expressions for each will be:
aaa =ListItem([Filename (path)],Math(ListCount([Filename (path)],\)-2),\)
bbb =ListItem([Filename (path)],Math(ListCount([Filename (path)],\)-1),\)
Copy/paste all of the blue text.
You could also use both of these strings to add expression columns or categories to a view directly. Just ask if you're not sure what I mean by that.
Regards,
-marko
-
> aaa =ListItem([Filename (path)],Math(ListCount([Filename (path)],\)-2),\)
> bbb =ListItem([Filename (path)],Math(ListCount([Filename (path)],\)-1),\)
Excellent - thanks Mark.
BTW, re:
> You'll need to add a couple of custom fields to your library.
I found this unnecessary for my use in the Device Audo Path - the Options field accepted these expressions directly.
> For the following strings to work, you must be using MJ14 as MJ12 does not have the math capability.
Can you tell me where the Math() function is documented? Not in the Help, as far I can see.
-
Your welcome.
I found this unnecessary for my use in the Device Audo Path - the Options field accepted these expressions directly.
Indeed. You could also use them to create file list columns or view categories directly. I suggested using them to add custom fields as you did not state how/where you wanted to use the information, and as a library field, you could use it just about anywhere you fancied.
Can you tell me where the Math() function is documented? Not in the Help, as far I can see.
It's one of the functions missing from the expressions page on the wiki (http://wiki.jrmediacenter.com/index.php/Media_Center_expression_language), which is currently being re-written. That's a slow process though and the new page probably won't surface for another week or two.
-marko.
-
I suggested using them to add custom fields as you did not state how/where you wanted to use the information
Indeed I omitted to say. Thanks.
It's one of the functions missing from the expressions page on the wiki (http://wiki.jrmediacenter.com/index.php/Media_Center_expression_language), which is currently being re-written. That's a slow process though and the new page probably won't surface for another week or two.
Thanks MrC for this subsequnt addition: http://wiki.jriver.com/index.php?title=Media_Center_expression_language&diff=6799&oldid=6164
Is MrC's source publicly visible?
-
You're welcome. My "source?". I suppose you mean this page (http://yabb.jriver.com/interact/index.php?topic=59116.0).
-
I suppose you mean this page.
I get:
An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you
-
Fixed MrC's link above.
-
Oops, Gesundheit.
-
Die Fledermaus.
-
Fixed MrC's link above.
Thanks Jim.
And thanks MrC for the page - very nice to see the "secret" functions listed. It will be great when these are made official and documented!