rednoah wrote:Lots of examples here in the forums somewhere.
genres.contains('something') ? A : B
A ternary operator like that is nice if I only had 2 options, but I basically need an if / else if / else if / else if / else.
if genres contain "Romance" then folder name is "Chick Flick"
else if genres contain ....
Nesting the ternary doesn't appear to work
Code: Select all
{genres.contains('Romance') ? 'Chick Flick' : {genres.contains('Animation') ? 'Animation' : 'Nope'} }
Yields
Script106$_run_closure1@6612fddc
I think I figured out the if syntax:
Code: Select all
X:\Array\Movies\{
if (genres.contains('Romance')) {'Chick Flick'}
else if (genres.contains('Animation')) {'Animation'}
else if (genres.contains('Horror')) {'Horror'}
else if (genres.contains('Family')) {'Family'}
else if (genres.contains('Science Fiction')) {'Science Fiction'}
else if (genres.contains('Fantasy')) {'Science Fiction'}
else if (genres.contains('Comedy')) {'Comedy'}
else if (genres.contains('Documentary')) {'Documentary'}
else if (genres.contains('History')) {'Documentary'}
else if (genres.contains('Drama')) {'Drama'}
else if (genres.contains('Adventure')) {'Adventure'}
else 'Action'
}\{n} ({y})
It's really a shame that the built in editor doesn't allow multi-lines, then just ignore whitespace when parseing