As I said above, MC includes an expression language that can be used to manipulate text, fields, the Auto-Import rules, and to create custom calculated fields. It can do math, and has a wide variety of text manipulation functions, evaluate Regular Expressions, and all sorts of other crazy things. Expressions can be used within the
Search Language system in MC as well.
The
Expression Language Wiki article I linked to is quite thorough and detailed (thanks MrC wherever you are), and can teach you all about the Expression Language.
But, for now... All that brings us to is what the heck Matt was telling you to do.
Well, that's actually pretty simple. He's telling you to use a little expression instead of the default output for your field that sometimes ends up blank. That will let you override the default behavior of the Rename, Move, and Copy Fields tool, because your expression is not a
Field, so it is "allowed" to output blank. It will output
exactly what you tell it to output. His expression is a simple one, and good for "starting off" which is why I took this opportunity to explain. Just diving right into that Expression Language tome on the Wiki can be overwhelming.
First, the most important function in the Expression Language is probably the
If() function. It is conceptually simple. It lets you test something, and output one thing if the result is True, and something else if the result is false. It looks like:
If(<TEST>,<OUTPUT IF TRUE>,<OUTPUT IF FALSE>)So, say you have a field called [Color] that can contain any color you want. And then you make another calculated field (which is a special kind of custom field that is calculated for each file using an Expression) that you want to output the words "My Favorite Color" for any file where the [Color] field contains "blue"*. And otherwise output "meh". Your expression would be constructed like this using the
IsEqual() function to test the [Color] field for equality with "blue":
If(IsEqual([Color],blue,1),My Favorite Color,meh)
The IsEqual() part of the expression is the <TEST> of the If() statement. In this example, we test to see if [Color] == "blue" and if so, we output some text. Otherwise, we output some other text. The 1 that is part of the IsEqual() function tells IsEqual to run in case insensitive mode. There are other modes. Then, the rest just outputs the text we wanted.
Matt's expression doesn't use IsEqual() though. Instead, it uses
the IsEmpty() function as the <TEST> in the If(). This tests to see if the provided value is empty or not. It returns 1 (True) if the provided value evaluates to empty, and 0 (False) if it does not.
So...
If(IsEmpty([Bios,0]),,[Bios])
This tests to see if [Bios] is empty. If so, it actually outputs
nothing at all. See how there are double commas? The <OUTPUT IF TRUE> part of the If() expression is completely blank. So, if the result of the <TEST> is true, it outputs blank. If the IsEmpty() test is
False (and so then [Bios] does contain something useful), then it outputs the contents of [Bios].
So, this is a stand-in replacement for the way Rename, Move, and Copy Files normally treats [Bios] that does what you want it to do, and really outputs blank. The last part that I should mention is the fact that the IsEmpty() test includes an odd zero after the name of the Bios field:
[Bios,0]That's a
special notation that tells MC to turn off the normal field processing that occurs for display and show the raw value. For example, you can use it with [Date] to show the "real" internal date value (which work like dates in Excel). Or, you know how if you set [Disc #] to zero, then it actually "vanishes"? That's because for display (in normal "friendly" field-display mode) MC hides values that equal Zero. If you want to see the Zero when it exists, then you can make MC output the "raw" value by doing [Disc #,0].
Now, it is unlikely that you'll use [Bios] in your Rename, Move, and Copy Files rule, so perhaps a more useful example is [Disc #].
Here's my rule for renaming Music Files:
Audio\Music\[Artist Letters]\[Artist]\[Album]\If(IsEmpty([Disc #],1),,[Disc #])
So, in that case, I only want it to make a Disc # "tier" of folders if the particular file being renamed contains a non-zero [Disc #] (note, I didn't use the [Disc #,0] notation there, because I'm testing to see if it is empty. So, if I rename a file that does not have a disc number at all, then it doesn't get any folder at that level and the files are there. If the album does contain disc numbers, then there is another "tier" of folders labeled 1, 2, 3, etc.
Click to embiggen.See how Dark Side gets no Disc Number part of the path at all, but Ummagumma (which has multiple discs) does?Your expressions in there can be as complex as you want. If you have a particularly complex one, you can make the expression itself into a custom calculated Field, which basically works as a "shortcut" for the expression. That's what I did above with the [Artist Letters] field. That's a custom calculated field I made that uses the expression:
Regex([Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), 0 - 9, [R1])
That ugly string of nonsense does this:
I hope all this makes sense, but read up on the wiki article a bit, play with it, and ask if you need to know more.
* No yelloooooooow!