Page 1 of 1

Reuse AMC functions within exec

Posted: 23 Mar 2018, 13:42
by devster
Is it possible/allowed to use getNotificationTitle() and getNotificationTitle() in an exec block?

Code: Select all

$ filebot -script fn:amc ... --def exec="echo {getNotificationTitle()} {getNotificationTitle()}"

Re: Reuse AMC functions within exec

Posted: 23 Mar 2018, 15:11
by rednoah
Sorry, that won't work. The format expression context is completely different from the script execution context, so it's not possible to hook into variables and methods from the other context.

Re: Reuse AMC functions within exec

Posted: 23 Mar 2018, 17:23
by devster
That's too bad. I recently found a command line tool for notifications, https://github.com/caronc/apprise that seems quite flexible. I wanted to use the same format of notification currently used by the AMC script but for Discord, which apprise supports.

Re: Reuse AMC functions within exec

Posted: 23 Mar 2018, 20:35
by devster
Is it possible to recover the rename log from just the last sequence?
That might have all the info needed to replicate the behaviour of getNotificationTitle() in a separate script.

Re: Reuse AMC functions within exec

Posted: 23 Mar 2018, 23:05
by rednoah
FileBot does not keep logs in memory after printing them to console, so there's no way to access them. You'd have to parse the console output and then call commands yourself in your own amc script wrapper shell script.

If you enable html reports, then there'd be html files on your hard disk that you could read to get that piece of information. But not sure if those are written before or after --def exec is called.

You could also try reading the history xml file. But that also probably only gets updated when FileBot exits.