How do scripts run by Hazel get their environment?

For me, the most frustrating aspect of developing scripts that should be triggered by Hazel is this:
I develop and test the script in CodeRunner, where they work.
When I run them in Hazel and they fail, it is because the environment Hazel provides for the scripts is different/limited compared to the environment of my Terminal user:
- paths are missing or bogus (e.g. a path is /usr/gnu/bin; no idea where that comes from as it is set nowhere in /etc/paths, /private/etc/paths.d or .bash_profile. That also means no external command installed through a package manager is found when the script is run by Hazel.
- same with LOCALE; my LANG user settings are de_AT.UTF-8. Under Hazel, the scripts show a locale of en_AT.UTF-8, which is also bogus. Such a locale does not exist.
- settings for external commands are not found
Even after a lot of searching, I have not found an answer as to what environment information Hazel passes to the scripts it executes:
Thanks,
Guy
I develop and test the script in CodeRunner, where they work.
When I run them in Hazel and they fail, it is because the environment Hazel provides for the scripts is different/limited compared to the environment of my Terminal user:
- paths are missing or bogus (e.g. a path is /usr/gnu/bin; no idea where that comes from as it is set nowhere in /etc/paths, /private/etc/paths.d or .bash_profile. That also means no external command installed through a package manager is found when the script is run by Hazel.
- same with LOCALE; my LANG user settings are de_AT.UTF-8. Under Hazel, the scripts show a locale of en_AT.UTF-8, which is also bogus. Such a locale does not exist.
- settings for external commands are not found
Even after a lot of searching, I have not found an answer as to what environment information Hazel passes to the scripts it executes:
- Is this dependent on the environemnt of the parent/calling process?
Is there a way to make sure that Hazel passes the same environment settings to the scripts it triggers?
Thanks,
Guy