Page 2 of 2

Re: [HIRE REQUEST] Modified AMC script

Posted: 29 Apr 2014, 02:23
by rednoah
Just copy what I'm doing. Something like:

Code: Select all

def message = output.getNameWithoutExtension().unique().sort{ it.toLowerCase() }.join('\n')
println message

Re: [HIRE REQUEST] Modified AMC script

Posted: 29 Apr 2014, 04:34
by Tweak_four17

Code: Select all

MissingPropertyException: No such property: output for class: Script3
groovy.lang.MissingPropertyException: No such property: output for class: Script3
	at Script3.run(Script3.groovy:324)
	at net.sourceforge.filebot.cli.ScriptShell.evaluate(ScriptShell.java:91)
	at net.sourceforge.filebot.cli.ScriptShell.runScript(ScriptShell.java:85)
	at net.sourceforge.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:123)
	at net.sourceforge.filebot.Main.main(Main.java:192)
Failure (°_°)
and then

Code: Select all

def message = {output.getNameWithoutExtension().unique().sort{ it.toLowerCase() }.join('\n')}
outputs

Code: Select all

Script3$_run_closure61@50f3a0e8
I've got nothing.

Re: [HIRE REQUEST] Modified AMC script

Posted: 29 Apr 2014, 05:56
by rednoah
The output variable doesn't magically just exist...

Code: Select all

def output = getRenameLog().values().toList()
def message = output.getNameWithoutExtension().unique().sort{ it.toLowerCase() }.join('\n')
println message
Also { ... } means it's a closure, not a value. So if you want the value that a closure evaluates to you need to call it.

e.g.

Code: Select all

def two = { 1 + 1 }
println two
println two()
You can try some tutorials on the Groovy, so that should help on understanding how it works a lot.

Re: [HIRE REQUEST] Modified AMC script

Posted: 29 Apr 2014, 16:40
by Tweak_four17
Well after many many different combinations and lots of googling I think I got it

Code: Select all

def output = getRenameLog().values().toList()
def getNotificationMessage = {output.collect{ it as File }*.getNameWithoutExtension().unique().sort{ it.toLowerCase() }.collect{ "• $it" }.join('\n')}
And it appears to be sending me just the output file name to my pushover. Yikes that was tough. Thanks for your help rednoah!