0

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.

2
  • 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
    Commented Jun 20, 2013 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
    Commented Jun 20, 2013 at 15:04

1 Answer 1

1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .