Set shell-variable in format expression

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
just.RooT
Posts: 3
Joined: 19 Apr 2014, 15:30

Set shell-variable in format expression

Post by just.RooT »

Hi guys,
after my filebot script moved the the series to the right place, i want to make other things with the series in the new location.
So i thought the best way would be to export or declare the variable after my "--format"-statement like this:
--def exec="newdestpath=\"{file}\""
the filebotvariable "{file}" is the full path of the moved file.

but when i use the variable one line later...:


echo " New Destination Path :" $newdestpath

.... its empty.


Is there a better way to get the full path to the new location?

Thanks for helping!
just.RooT
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Set shell-variable in format expression

Post by rednoah »

--def exec is for executing external tools. So you probably wanna use --def exec to call whatever you wanna call in your bash script anyway, with the variables you need for your custom post-processing script.

Note that exec is called for each processed file, so "setting a variable" doesn't cut it.

If you're modifying the amc script you should just look into the code a bit. For example the rename() call returns the list of destination files. Also you can access the Map of source/destination files anytime with getRenameLog().
:idea: Please read the FAQ and How to Request Help.
Post Reply