I think the best way to do it is to create a context menu entry similar to "Open in Terminal..." for directories in nautilus.
I do not know how to map nautilus menu entries to a key (You can activate the entry with multiple keys using the context menu by keyboard, like with Menu).
But as you seem to already solved the key mapping part, maybe some hints on how to configure a menu entry for the script help:
For starting gnome-terminal
with a specific start directory for the shell, there is an option --working-directory
:
gnome-terminal --working-directory /some/java/dir -e startscript.sh
There is a nautilus
extension to add menu entries: "Nautilus Actions". That would allow to implement the context menu that supplies the directory to use from nautilus.
It is described in one of the answers of How do I customize the context menu in Nautilus?.
(See also How can I add a custom item to the nautilus context menu, but NOT in a sub-menu?)