Take a look at the Shell commands community plugin. From the description, it lets you pass the current file name and path to a script. I’m assuming that you can call your scripting engine from the command line. If that’s not the case, you probably need another solution.