Get a script's directory in order to load templates or other resources in a relative path