I updated to macOS 12.3, which removed /usr/bin/python. I suddenly ran into a problem with a Hazel rule using an embedded script that started throwing errors. I tracked it down to the fact that the script calls a python script (not written by me, something I downloaded) that uses /usr/bin/env python as the shebang line, and in the non-interactive shell, there's nothing to be found for that. I added a line in the embedded script in Hazel to set the PATH variable beforehand, and that allows it to run.
But I don't really love the idea of needing to remember to hardcode PATH in any embedded script where a python script is going to be used. And I can't find any "proper" way for macOS to adjust the environment variables in this case. I have things set up in my own environment so this script runs fine, but that doesn't come through to the embedded script, obviously.
Is there something I'm missing? And if I'm not missing anything, would it be possible to add a feature for Hazel to automatically set an environment variable when it runs scripts?