[DOCS] FileBot Groovy Expression References

Talk about the Ultimate Question of Life, The Universe, and Everything
Post Reply
User avatar
rednoah
The Source
Posts: 16767
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[DOCS] FileBot Groovy Expression References

Post by rednoah » 20 May 2019, 07:16

FileBot uses the Groovy language for format expressions, filter expressions and execute expressions:
http://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.

:!: You can read / write / modify to your liking / generally make sense of typical FileBot format / filter / exec expressions without understanding how any of it works under the hood. ;)
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 334
Joined: 06 Jun 2017, 22:56

Re: [DOCS] FileBot Groovy Expression References

Post by devster » 05 Jun 2019, 18:32

Pardon my nosiness, how do you generate these pages?
They're a real eye opener, for example I had no idea String.match() could accept a map.
I only work in black and sometimes very, very dark grey. (Batman)

User avatar
rednoah
The Source
Posts: 16767
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DOCS] FileBot Groovy Expression References

Post by rednoah » 05 Jun 2019, 18:37

The FileBot API Documentation is generated from the source using the javadoc tool.
:idea: Please read the FAQ and How to Request Help.

Post Reply