INTERACT FORUM

More => Old Versions => JRiver Media Center 19 for Windows => Topic started by: raldo on June 27, 2014, 02:03:56 pm

Title: Expression field evaluates incorrectly when used in a file move operation.
Post by: raldo on June 27, 2014, 02:03:56 pm
I've defined an expression field which extracts nested events from the keyword tag.

The expression is defined as follows in the "manage library fiels" in options:

[.Event] = if(regex([Keywords],/#(!Events[^;]+)#/,0),replace([R1],!Events\,),)&datatype=[list]

so it's a regular expression (which I didn't come up with) which strips the text before and including "!Events\" and strips the text after and including the first semicolon after "!Events\"

This expression works when used in view schemes but it does not work when used in a file move operation:

I've set up the base path as \\server\Photos and the rule as [.Events]

The resulting "to folder" contains "!Events_" .

As an example with above base and rule. A Keyword "!Events\Test" would yield "to folder" \\Server\Photos\!Events_Test\filename

This is not correct behavior?
Title: Re: Expression field evaluates incorrectly when used in a file move operation.
Post by: MrC on June 27, 2014, 02:07:32 pm
Use [Keywords,0] in a Rename operation.

Search Rename in the text here:

   http://wiki.jriver.com/index.php/Expression_Language
   
Title: Re: Expression field evaluates incorrectly when used in a file move operation.
Post by: raldo on June 27, 2014, 02:31:39 pm
Use [Keywords,0] in a Rename operation.
...

Exactly! Thanks.
Title: Re: Expression field evaluates incorrectly when used in a file move operation.
Post by: mark_h on June 28, 2014, 02:36:17 am
The [...,0] notation still trips me up from time to time, particularly when I haven't used it for a while.