INTERACT FORUM

More => Old Versions => Media Center 15 (Development Ended) => Topic started by: tombert on January 09, 2011, 07:12:59 am

Title: Expression Help Please ...
Post by: tombert on January 09, 2011, 07:12:59 am
Trying to build the following expression:

If(IsEqual([Album Artist (auto)],/(Multiple Artists/),1),[Album],[Artist]\[Album])

In the pane window the expression is correctly displayed, but when using it in e.g. file copy operations then the backslash is replaced with an underscore.

Pane:
Herbert Grönemayer\Mensch

File copy:
Herbert Grönemeyer_Mensch

thx
Title: Re: Expression Help Please ...
Post by: lise on January 09, 2011, 11:34:25 am
Try putting a forward slash before the backslash that you want, e.g.

If(IsEqual([Album Artist (auto)],/(Multiple Artists/),1),[Album],[Artist]/\[Album])

forward slash acts as the escape character (I think that's the term used) enabling the next character to show up as a character.
Title: Re: Expression Help Please ...
Post by: marko on January 09, 2011, 12:02:41 pm
lise, I don't think that's going to work because typically, the backslash character does not need to be escaped.

tombert,
Where/how are you initiating the file copy operation?

If I use your given expression in the directory rule of the "Rename move and copy files" tool, it works as expected, without an underscore.
You saved the expression as a custom library field, right?

If I am right, let's say your custom field is called [folder], when you use it in the rename move and copy tool, try wrapping it in a replace() expression...

replace([folder],_,\)

Does that help?

-marko.

Title: Re: Expression Help Please ...
Post by: tombert on January 09, 2011, 01:03:03 pm
Try putting a forward slash before the backslash that you want, e.g.

If(IsEqual([Album Artist (auto)],/(Multiple Artists/),1),[Album],[Artist]/\[Album])

forward slash acts as the escape character (I think that's the term used) enabling the next character to show up as a character.

Doesn't work - it's still replaced by an _
Title: Re: Expression Help Please ...
Post by: tombert on January 09, 2011, 01:06:47 pm
lise, I don't think that's going to work because typically, the backslash character does not need to be escaped.

tombert,
Where/how are you initiating the file copy operation?

If I use your given expression in the directory rule of the "Rename move and copy files" tool, it works as expected, without an underscore.
You saved the expression as a custom library field, right?

If I am right, let's say your custom field is called [folder], when you use it in the rename move and copy tool, try wrapping it in a replace() expression...

replace([folder],_,\)

Does that help?

-marko.


This replace stuff works ... it complicates the "ease" of use ... but it works ...
thx
Title: Re: Expression Help Please ...
Post by: Vincent Kars on January 09, 2011, 03:11:16 pm
I think it is by design.

The \ is used in Win for dirs. So having \ in a filename might yield unwanted results.