How can I store the renamed episode name (ie Archer S05E08), or any file that gets renamed as a bash variable? I'm trying to setup a notification system to setoff growl notifications on other computers, as well as make pushover notifications look nicer.
Right now I have it working with the $TR_TORRENT_NAME, but thats kind of ugly seeing the full path of all torrents, and notifications usually truncate them because of the length.
Ideally in my amc script, as well as in other custom scripts I'd be able to set it using a groovy tag (ie var={n.replaceTrailingBrackets()}) or just set it equal to the output from filebot CLI.
Anyway to do this?
Thanks.
Set name of Show to variable
Re: Set name of Show to variable
Passing --def exec is probably the best way to chain any kind of post-processing:
--def exec=touch "{file}" Run program on newly processed files
Re: Set name of Show to variable
Thanks for the reply. I got it working.
For anyone that comes across this looking to do something similar, here's what I did.
Because exec executes in a sub shell inheriting it's parent's environment, you can't pass a variable back to the parent (in this case your amc script) without doing something fancy. So the simplest thing to do is to crate a new script and pass ONLY FILE BINDINGS - not episode or movie ones as they won't work (http://www.filebot.net/naming.html) and call it with --def exec. ie:
Once you've done that, script away in your new file that will execute after filebot runs the amc script, and it will have access to any of the bindings you passed it via command line arguments.
Hope this helps.
For anyone that comes across this looking to do something similar, here's what I did.
Because exec executes in a sub shell inheriting it's parent's environment, you can't pass a variable back to the parent (in this case your amc script) without doing something fancy. So the simplest thing to do is to crate a new script and pass ONLY FILE BINDINGS - not episode or movie ones as they won't work (http://www.filebot.net/naming.html) and call it with --def exec. ie:
Code: Select all
"exec=/home/user/path/to/script/ \"{fn}\""
Hope this helps.