Store format result into vars in a script

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
tresi
Posts: 13
Joined: 30 Jun 2019, 15:51

Store format result into vars in a script

Post by tresi »

Hello,

is it possible to store the resulting format value into a var/an array to use it in a custom script without doing something else?
Has filebot native support for such an approach?

At the moment I am using this (simplified) code to get all matching values into a loop or an array:

Code: Select all

filebot {CUSTOM_ARGS} --action test --format "{CUSTOM_FORMAT}" -rename "{SINGLE_FILE OR DIR}" | grep "\[TEST\]" | cut -d'[' -f4 | while read file;
      echo "$file"
do
Thanks a lot in advance.

Kind regards,
tresi
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Store format result into vars in a script

Post by rednoah »

I'd use the -exec option for that kind of use case:
viewtopic.php?t=5047

e.g.

Code: Select all

-exec echo {f} +
:idea: Please read the FAQ and How to Request Help.
tresi
Posts: 13
Joined: 30 Jun 2019, 15:51

Re: Store format result into vars in a script

Post by tresi »

Simple and effective. Thanks for that.

...btw... is it possible to suppress the progress outputs from Filebot?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Store format result into vars in a script

Post by rednoah »

tresi wrote: 26 Jul 2019, 14:26 ...btw... is it possible to suppress the progress outputs from Filebot?
What are you talking about specifically?


Turn on important logging only:

Code: Select all

--log INFO

Turn off all logging:

Code: Select all

--log OFF
:idea: Please read the FAQ and How to Request Help.
tresi
Posts: 13
Joined: 30 Jun 2019, 15:51

Re: Store format result into vars in a script

Post by tresi »

:oops:

Thx!
Post Reply