INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Problem with IsEmpty expression  (Read 1431 times)

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Problem with IsEmpty expression
« on: April 15, 2012, 08:00:00 pm »

One of my long-time rename expressions is no longer working.

The expression is:
Code: [Select]
if(IsEmpty([Featuring]),[Name],[Name] /(feat. [Featuring]/))
I have a custom list-type [Featuring] field where I add any featuring artists which are not the primary artist.
Where this field is populated, I like to append (feat. [Featuring]) to the end of the filename in rename operations.

Eg. Warren G - Regulate (feat. Nate Dogg).flac

Up until now I've used IsEmpty, but this doesn't seem to work anymore. The output always assumes the field is populated even when it's empty. The expression has been stored in my MC library for years now, but it's only recently stopped working for rename operations.

Now, for files where there is no 'Featuring' artist (ie [Featuring] is empty, MC is appending 'feat. Unknown Featuring' to the end of the filename.
It's worth noting when I test the same expression it works fine when in-line editing (panes view etc) - it's only not working when I use it in Rename/Move/Copy files.

Any ideas?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Problem with IsEmpty expression
« Reply #1 on: April 15, 2012, 10:46:38 pm »

Try using:

  [Featuring,0]

instead of just:

  [Featuring]
Logged
The opinions I express represent my own folly.

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: Problem with IsEmpty expression
« Reply #2 on: April 16, 2012, 01:26:54 am »

Thanks MrC - I'll give it a try tonight. Does the rename/move tool handle expressions differently to the program  in general ?

PS what does the 0 do?
Logged

221bBS

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 703
Re: Problem with IsEmpty expression
« Reply #3 on: April 16, 2012, 06:18:10 am »

I always use a library expression field when I rename my files, both for files and folders. I've never had a problem.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Problem with IsEmpty expression
« Reply #4 on: April 16, 2012, 12:12:22 pm »

...Does the rename/move tool handle expressions differently to the program  in general ?

PS what does the 0 do?

Yes, and in several ways.  Here's the relevant one:

17.0.114 (3/26/2012)

1. Changed: When using list fields in Rename, Move, & Copy Files expressions, the full list can be retrieved by using 0 as the second field parameter (example: [Keywords, 0]).

Adding the 0 modifier to a field instructs MC to evaluate to the raw data, and not format it relative to the field's context.
Logged
The opinions I express represent my own folly.

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: Problem with IsEmpty expression
« Reply #5 on: April 16, 2012, 09:18:35 pm »

I always use a library expression field when I rename my files, both for files and folders. I've never had a problem.

So have I - but this only changed recently. It must be related to the change MrC mentioned in .114.

Yes, and in several ways.  Here's the relevant one...

Thanks MrC. It works perfectly now. Thanks for clearing that up.
Logged
Pages: [1]   Go Up