[DOCS] FileBot Groovy Expression Reference Documentation

All about user-defined episode / movie format expressions
Locked
User avatar
rednoah
The Source
Posts: 18621
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[DOCS] FileBot Groovy Expression Reference Documentation

Post by rednoah » 20 May 2019, 07:16

FileBot uses the Groovy language for format expressions, filter expressions and execute expressions:
https://groovy-lang.org/single-page-documentation.html


The most important top-level bindings are documented here:
https://www.filebot.net/naming.html


In addition to that, the entire FileBot / Groovy / Java API is at your disposal:
:!: The complete reference documentation for FileBot / Java / Groovy is so mind-bogglingly vast that it's likely going to be completely useless for your specific relatively simple coding needs.

:!: You will need Java / Groovy coding experience to navigate this vast amount of reference documentation.


e.g. Why does this work?

Code: Select all

{f.name.match(/regex/)}
  1. {f} is a top-level binding defined by FileBot, which returns a File object.
  2. File.getName() is called via the Groovy Getter Syntax and returns a String object.
  3. String.match(String regex) is a Groovy Extension Method for the String class specific to FileBot.

:!: DON'T PANIC! You can read / write / modify custom formats to your liking and generally make sense of your typical FileBot format / filter / exec expression without any understanding of how any of it works under the hood. Although the complete reference documentation is vast, you'll need to understand little to none of it for your typical custom format / filter / exec expression. ;)
:idea: Please read the FAQ and How to Request Help.

Locked