Containing Folder Names

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

Moderator: Mr_Noodle

Containing Folder Names Wed Jan 01, 2020 4:40 pm • by bcossiboom
I thought this attribute would/should work for what I need, but can't seem to get it to do anything.

I would like to add tags to file(s) inside a folder with each tag being the all the folders prior (including the source folder).

Structure
Folder A
Folder B
Folder C
File 1

I'm trying to tag File 1 with separate tags "Folder A," "Folder B," and "Folder C." I've tried using "Add Tags" and then Use Dynamic Tags "Other" and the "Containing Folder Names" attribute and it just doesn't seem to do anything. I know I'm reaching the file with Hazel b/c I can add other tags. I'm sure I'm just missing something and would appreciate any insight.

Alternatively, is there a way that a folder/file can inherit tags from it's source folder? I haven't identified how that can be done (I'm pretty new at this), but thought that might be a way to attack this as well.

Many thanks!
bcossiboom
 
Posts: 3
Joined: Wed Jan 01, 2020 10:01 am

Re: Containing Folder Names Thu Jan 02, 2020 12:01 pm • by Mr_Noodle
The formatting didn't come through here but I'm guessing Folder C is in Folder B which is in Folder A. Will it always be three folders deep or is it some arbitrary number?

For the simpler case of just using the parent folder, you can do something like:
Code: Select all
If (all) are met
    If (all) are met for (the enclosing folder)
        Name matches (•parent folder name)


where (•parent folder name) is a custom attribute set to match (anything). That will capture the name of the parent folder which you can then use in a dynamic tag.

You can add additional nesting levels to each folder above that but it does require that the number of levels is fixed.
Mr_Noodle
Site Admin
 
Posts: 11230
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Containing Folder Names Thu Jan 02, 2020 2:25 pm • by bcossiboom
Thanks - yes, you're correct about the structure (my apologies the formatting didn't come through). It could be any folder depth so I don't think the parent folder method will get what is needed.
Many thanks,
-Brian
bcossiboom
 
Posts: 3
Joined: Wed Jan 01, 2020 10:01 am

Re: Containing Folder Names Thu Jan 02, 2020 5:25 pm • by bcossiboom
Is there by chance a way to folder/files inherit tags from the containing folder? That way the tags would accumulate regardless of the level of the folder by tagging the next level folder with the parent's folder name?
bcossiboom
 
Posts: 3
Joined: Wed Jan 01, 2020 10:01 am

Re: Containing Folder Names Fri Jan 03, 2020 11:58 am • by Mr_Noodle
No good way to do that now unless you are looking for specific tags or a limited number of them. You would probably need a script to do that (the tag transfer part).
Mr_Noodle
Site Admin
 
Posts: 11230
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support