Matching a path component

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Matching a path component Sat Dec 17, 2022 4:32 pm • by hexadecagram
Is it possible to create a rule with an attribute that matches a path component? For example, if I have a file whose full pathname is /Users/hexadecagram/Documents/myfolder/myfile.txt, can I match "hexadecagram" somehow?
hexadecagram
 
Posts: 5
Joined: Sun May 30, 2021 8:49 pm

Re: Matching a path component Mon Dec 19, 2022 11:23 am • by Mr_Noodle
In the attribute pop-up, select "Other". If "File pathname" is there, you should be able to use that with "matches".
Mr_Noodle
Site Admin
 
Posts: 11226
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Matching a path component Fri Dec 23, 2022 7:12 pm • by hexadecagram
Wow! Lots of stuff in there! I ended up writing a shell script to do the job, which is also a nice feature. Good stuff!
hexadecagram
 
Posts: 5
Joined: Sun May 30, 2021 8:49 pm


Return to Open Discussion