Page 1 of 1

Run only on single file being added to a subfolder [SOLVED]

PostPosted: Thu Jan 11, 2018 9:06 pm
by K1TSUNE
Hello,

I find Hazel extremely difficult to figure out, perhaps I'm trying to do something it can't do. But I'm assuming it can with the right rules logic.

What I'm trying to accomplish
I have a TVSHOWS folder within it TVshows (IE: Breaking Bad)
In each TVshow folder, there are Season folders (Season 01, Season 02, etc..)
When a .srt file is added for an episode I need Hazel to run a shell script (forwarding the file+path to a python script that will clean up the .srt file)

Based on the support document I currently have;
"ON CHANGE"
Same as here: https://www.noodlesoft.com/manual/hazel ... ubfolders/

Then the set of rules in "CLEAN SUBS"
(for testing) display a notification if the file extension contains 'srt'



Problem with the above is that it does run on the file I add but then also does ALL other .srt files in the entire TVSHOWS folder even though I only add a single .srt file to one specific Season folder.

Any help is greatly appreciated, I'v already wasted 2 hours of my life on this.

Re: Run only on single file being added to a subfolder

PostPosted: Fri Jan 12, 2018 11:36 am
by Mr_Noodle
Can you post your rule to process .srt files?

Re: Run only on single file being added to a subfolder

PostPosted: Fri Jan 12, 2018 1:10 pm
by K1TSUNE
So like I said it uses the subfolder code from support doc:
Image

Rules for finding any .srt in an updated/changed folder:
Image

Folder structure example:
    TVSHOWS
      Mr. Robot
        Season 01
        Season 02
        Season 03
      Shut Eye
        Season 01
        Season 02

Re: Run only on single file being added to a subfolder

PostPosted: Sat Jan 13, 2018 4:08 pm
by K1TSUNE
So again what I'm trying to accomplish is when is say when a .srt file gets added to a Season folder, it will run the rules on just that file, or if that's not possible, just that single folder that has been updated ("date modified?")

Re: Run only on single file being added to a subfolder

PostPosted: Mon Jan 15, 2018 11:07 am
by Mr_Noodle
If you only want to have the rule match the first time the file is added, try adding a condition like "Date added is after date last matched".

Re: Run only on single file being added to a subfolder

PostPosted: Wed Jan 17, 2018 2:45 pm
by K1TSUNE
That date match rule is a good addition.

It seems though that I just had to first let it "notify" each and every single match.

From that point on it not notifies (runs the rules) whenever I add a .srt file, instead of (what it seemed to be doing) running it on any .srt file.

So it wasnt until I let it run for a good time that it is now where it'll just work on a each new file.