Hey hey
I'm trying (in MC13, build 171) to rename my files using some if constructs, to only include e.g. Date (Year) in a folder name if it exists (thus avoiding the "Unknown Year" thing). (And, btw, it really sucks that IsEmpty() doesn't work with file renaming).
Okay, so consider this directory rule:
[Name] If(IsEqual([Subtitle], Unknown Subtitle), , - [Subtitle]) If(IsEqual([Date (Year)], Unknown Year), , -[Date (Year)]-)
This produces (first one has no Subtitle but a Date (Year), second one has neither, third one has a Subtitle and a Date (Year)):
X:\Alien -1979-\
X:\Hero\
X:\The Ring 0 - Birthday -2000-\
Now, the same rule, except () instead of -- around the year:
[Name] If(IsEqual([Subtitle], Unknown Subtitle), , - [Subtitle]) If(IsEqual([Date (Year)], Unknown Year), , ([Date (Year)]))
X:\Alien (1979)\
X:\Hero )\
X:\The Ring 0 - Birthday (2000)\
So I read you can escape literals using a forward slash:
[Name] If(IsEqual([Subtitle], Unknown Subtitle), , - [Subtitle]) If(IsEqual([Date (Year)], Unknown Year), , /([Date (Year)]/))
X:\Alien \(1979\)\
X:\Hero )\
X:\The Ring 0 - Birthday \(2000\)\
Am I missing something completely or is there something really wrong with the expressions editor? I think the idea of having an expressions editor is awesome (as are most other things in MC, it's just so well constructed), but something's amiss. One thing is that I can't insert " - ([Date (Year))" and keep the preceding space because function arguments are not enclosed in apostrophes or quotes, another is the thing described above. Where does that stray closing parenthesis come from?
Please point me to some documentation if I'm just being daft, but reading
http://wiki.jrmediacenter.com/index.php/Media_Center_expression_language didn't really help. It doesn't even note that you can't use IsEmpty() in the file renaming dialog (I tried doing IsEqual on dummy library fields of different types before finding a post on this forum that answered this question, hehe
)