Modify amc.groovy email

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
beanz
Posts: 2
Joined: 12 May 2016, 12:57

Modify amc.groovy email

Post by beanz »

Would you be able to tell me how to edit the amc.groovy code to alter the subject to include the processed file name instead of the pre-processed one?

I tried messing around with the line below, removing getReportTitle() and replacing it variations of { ':) ' + renameLog.to.name } but I can't figure out where the new file name is stored at this point in the code. Thanks for any help.

Code: Select all

title(getReportTitle())
User avatar
rednoah
The Source
Posts: 24037
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Modify amc.groovy email

Post by rednoah »

At this point the new filename is stored in the rename log / history. Full metadata may have been lost at that point, unless xattr metadata is enabled and working of course.
:idea: Please read the FAQ and How to Request Help.
beanz
Posts: 2
Joined: 12 May 2016, 12:57

Re: Modify amc.groovy email

Post by beanz »

Thanks for getting back to me. I'm not sure if I explained myself too well. I edited line 545 which I think is the email subject. I tried to incorporate part of the code in the table in the body of the email below. I just want to be able to put exactly what is in the "New Name" cell into the subject line, but I am unsure of groovy syntax. Thanks again.

Code: Select all

hr(); table {
						tr { th('Original Name'); th('New Name'); th('New Location') }
						renameLog.each{ from, to ->
							tr { [from.name, to.name, to.parent].each{ cell -> td(cell) } }
						}
User avatar
rednoah
The Source
Posts: 24037
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Modify amc.groovy email

Post by rednoah »

This thread is somewhat related to this:
viewtopic.php?f=8&t=3755

Depending on what you want to do, it might be easier to use the --def exec option to hook your own shell script into the amc script, without modifying the amc script.

If you do decide to hack the amc script, then you won't get around learning some Groovy, and spending time debugging the existing code until you understand how it works.

As a wise man once said:
A wise Man wrote:5. YOU CANNOT DEBUG CODE BY STARING AT IT. First thing, put print statements
that display a log message with the variables leading up to the problem area
and use that to trace through the code to find your error. Keep executing it
and adding debugging to see what's going on.
@see https://gist.github.com/anonymous/b65ca ... 5da70eeced
:idea: Please read the FAQ and How to Request Help.
Post Reply