Page 1 of 1

Modified files and python script

PostPosted: Sun Jun 16, 2024 8:24 am
by theworldorder
Hey all! I am testing the Hazel software right now, but I am not able to find a solution to my problem.

I have a folder with a lot of '.txt' files and I want to add the following rule to Hazel:

If - any file is modified - then - run python script.

For the rule I tried:
'Date Last Modified is not Date Last Opened'
'Sub-file/folder Count did change'

But both rules does not applies when I modify a file.

Also, for the script, I put:

Run shell script - embedded script - Shell: /bin/zsh
Script: python3 'path/to/script'

But nothing is working. Now, I do not know if the problem is the rule or the way that I put the script. If I run the script in terminal, works perfectly. But I really need that Hazel runs this script at every time that I modify a file.

Re: Modified files and python script

PostPosted: Mon Jun 17, 2024 8:45 am
by Mr_Noodle
Try the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Testing date modified vs date opened seems a bit weird. Are you sure that's what you want?

Re: Modified files and python script

PostPosted: Tue Jun 18, 2024 5:04 am
by theworldorder
Mr_Noodle wrote:Try the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Testing date modified vs date opened seems a bit weird. Are you sure that's what you want?


Solved! The problem was not the script, because I used other rules and the script ran smoothly.

The correct condition is in "others" and called "Modified content in..." after this I just put "did change" and any change that I made in any file inside the folder runs the script, as desired!