Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

share|improve this question
    
Instead of calling sys.exit(), try running a command that you know will fail, for example trying to import 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... –  MattDMo Jun 20 '13 at 14:25
    
thanks. Tried that as well for good measure, but script still exits successfully - as with syntax error and divide by 0. Reported issue at Noodlesoft. Lead developer got back and it is a bug. "There is a bug now with shell scripts. I am issuing a patch, most likely tomorrow so hopefully you can hold on until then" –  Joop Jun 20 '13 at 15:04
add comment

1 Answer

up vote 1 down vote accepted

It was a bug that crept in with Hazel 3.1 ... Confirmed from Mr Noodle at Hazel. Works fine from 3.1.1 to current 3.1.1 now.

Just thought I'd complete the thread

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.