INTERACT FORUM

More => Old Versions => JRiver Media Center 23 for Windows => Topic started by: raldo on March 07, 2018, 03:20:31 pm

Title: Expression language and file paths
Post by: raldo on March 07, 2018, 03:20:31 pm
Hello,

I'm trying to make an expression for the rule part of a move and copy files operation.

The rule fails on a listitem expression which operates on a backslash delimited string. It seems as if MC behind the scenes replaces the backslash with underscores before inserting the parameter to the Listitem( ..) method.
assuming .Events for a file is a\b\c, then the following works and yields 2017 Summer a
[Year] [.Season] listitem([.Events,0], 0,  _)

Whereas using a backslash in the third parameter doesn't work.

Does anyone know away around this? Apart from never using underscores in .Events?
Title: Re: Expression language and file paths
Post by: marko on March 07, 2018, 03:23:43 pm
Assuming the "backslash delimited string" is a library field, try using use [field name,0] in your expression?
Title: Re: Expression language and file paths
Post by: raldo on March 07, 2018, 03:54:23 pm
Isn't that what I'm doing here:??
[Year] [.Season] listitem([.Events,0], 0,  _)
Title: Re: Expression language and file paths
Post by: marko on March 07, 2018, 04:17:30 pm
'tiz indeed, sorry about that.

I've not got an MC in front of me at the moment, but, up near the top of the rename tool, there's a tickbox about replacing slashes in expressions that I've never used... I can't recall exactly what it does. Is that any use for you?

The other thing I wondered was...

If you just want item zero, and just used [.Events] without the listitem, I'm almost sure it just defaults to item zero anyway, but again, without being able to test, I could be wrong about that too as it probably only does that for semicolon delimited lists. :)
Title: Re: Expression language and file paths
Post by: marko on March 08, 2018, 12:39:06 am
OK, I have an MC now...

The tick box is actually at the bottom, beneath the preview area, and seems to have no bearing on this.

I've also tested here using my keywords field, which contains nested keywords... ie., back slashes, and it seems to be working just as expected...
In the folder section...
(https://mpw.scot/pics/ia/23/snap-068.jpg)
and the file name section...
(https://mpw.scot/pics/ia/23/snap-069.jpg)

Any other tips for reproducing?
Title: Re: Expression language and file paths
Post by: raldo on April 22, 2019, 02:59:53 pm
Sorry, Marko, I just realized that I never thanked you for solution. Thanks!