Use folder/subfolder as tag

Hi I try to get all folders/subfolders as tags for a file. E.g. file „tax2020“ is in the subfolder „Tax 2020“ which is in the folder „Tax“, which is in the folder „Scanned documents“. I want hazel to automatically create the tags „Tax 2020“, „Tax“, „Scanned documents“ and to attach these tags to the file „tax2020“. I tried this solution: https://www.scrubbs.me/2014/05/20/tagging-all-the.html, which unfortunately did not work for me. I must admit, that I clearly did not understand the solution very well, so probably this was the problem.
I would really appreciate if someone could explain to me how to get in the subfolder structure and "tag" the folder structure one the way.
Thank you very much!
I would really appreciate if someone could explain to me how to get in the subfolder structure and "tag" the folder structure one the way.
Thank you very much!