You can use if-then-else blocks or the ternary operator for conditional code.
Example 1: Move 3D movies and normal movies into different folders:
Code: Select all
{fn =~ /3D/ ? '3D Movies' : 'Movies'}
Example 2: Add [10bit] to 10-bit videos but not to 8-bit videos:
Code: Select all
{if (bitdepth == 10) ' [10bit]'}
Code: Select all
{bitdepth == 10 ? ' [10bit]' : null}
Example 3: Sort movies into folders by collection if the movie belongs to a collection or genre folders if not:
Code: Select all
{any{collection}{genre}{'No Genre'}}

Example 4: Sort movies from different years into different destination folders:
Code: Select all
{
if (y < 1960) {
return "X:/Old Movie"
} else if (y < 2020) {
return "Y:/Classic Movie"
} else {
return "Z:/New Movie"
}
}


Code: Select all
{'Avatar'.match(/3D/) ? 'X' : 'Y'} ⇨ Exception: Pattern not found