I am using a Hazel (Noodlesoft) rule with Python script. Using the "Passes Shell script" option. Placing the path to my python install /usr/local/bin/python (my python install v. 2.7.3) in the shell box. Correctly goes to plack if it finds it and red if it cannot find it. Using the simplest script
import sys
sys.exit(1)
According to the tooltip exit status 0 indicates passing the rule. I assume anything else fails rule. Problem is that the rule matches regardless of the exit code returned.
Am I using the wrong command to provide Hazel with exit code or is it bug in Hazel. I am using the Latest (just released 3.1) Have not tried on previous versions.
sys.exit()
, try running a command that you know will fail, for example trying toimport
a module that you don't have installed. This will definitely cause the script to fail with an error. Check out PyPI and just pick a random package...