How to get Python scripts to fail quietly?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I have just written my first Python script for Hazel (an external script used in an action).
This works quite well, except for one thing:

Every time the script returns with "1" because it's preconditions are not met, Hazel shows a "Script failed..." notification.

I have tried both "sys.exit(1)" and "exit (1)", but the result remains the same.
In contrast, a bash script that is quit with "exit 1" does not produce such a notification.

Is there anything special that I have to do?

Thanks!
WorkflowsGuy
 
Posts: 30
Joined: Thu Jul 04, 2013 3:55 pm

Shell scripts are supposed to return 0 for successful execution. You only return non-zero status if there was an error.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support