Modified files and python script

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

Moderator: Mr_Noodle

Modified files and python script 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.
theworldorder
 
Posts: 3
Joined: Sun Jun 16, 2024 8:13 am

Re: Modified files and python script 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?
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Modified files and python script 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!
theworldorder
 
Posts: 3
Joined: Sun Jun 16, 2024 8:13 am


Return to Support