My problem is this:
I have a large file structure on an ext HD which is full of jpgs. The file structure has varying sub folder depths. Here is an example list of file paths:
- Code: Select all
Volumes/LaCie250GB/_ *untitled folder/2693386667_b.jpg
Volumes/LaCie250GB/_ *untitled folder/63abd75018_b.jpg
Volumes/LaCie250GB/_ *untitled folder/b9f99a2009_a.jpg
Volumes/LaCie250GB/*Untitled_Folder/img_B-TEC_01.jpg
Volumes/LaCie250GB/*Untitled_Folder/img_B-TEC_02.jpg
Volumes/LaCie250GB/*Untitled_Folder/img_B-TEC_03.jpg
Volumes/LaCie250GB/B-TEC_001/DSC0001.jpg
Volumes/LaCie250GB/B-TEC_001/DSC0002.jpg
Volumes/LaCie250GB/B-TEC_001/DSC0003.jpg
Volumes/LaCie250GB/Unsorted/to-sort/New Folder_01/01_B-TEC.jpg
Volumes/LaCie250GB/Unsorted/to-sort/New Folder_01/02_B-TEC.jpg
Volumes/LaCie250GB/Unsorted/to-sort/New Folder_01/03_B-TEC.jpg
Volumes/LaCie250GB/Unsorted/to-sort/New Folder_02/1.jpg
Volumes/LaCie250GB/Unsorted/to-sort/New Folder_02/2.jpg
Volumes/LaCie250GB/Unsorted/to-sort/New Folder_02/3.jpg
Volumes/LaCie250GB/Year_1/B-TEC-001.jpg
Volumes/LaCie250GB/Year_1/B-TEC-002.jpg
Volumes/LaCie250GB/Year_1/B-TEC-003.jpg
The HD holds around 15GBs of images and has varying sub-folder depths, the maximum being around 7, however most are at sub-folder depth 2 - LaCie250GB/Folder/Image.jpg
As you can see, some of the jpgs have the word "B-TEC" in the file name while some have the word "B-TEC" appearing somewhere in the file path, but not necessarily in the file name, which may be a hash instead. Some folders do not contain relevant images and do not have "B-TEC" in either in the file name or path.
I need to be able to look at the and HD and see where the B-TEC pictures are WITHOUT CHANGING THE FILE STRUCTURE OR MOVING FOLDERS AND FILES. The best way to do this is to simply colour code the folders which eventually contain a jpg with "B-TEC" in the name, or have the word "B-TEC" somewhere in the file path.
This means setting up a rule will look at each file path, see if the word "B-TEC" is contained somewhere within it, and set a colour label to the highest level folder in the file path if there is, or the entire file path if possible. In the example file paths above they would be:
- Code: Select all
Volumes/LaCie250GB/*Untitled_Folder/img_B-TEC_01.jpg
Volumes/LaCie250GB/B-TEC_001/DSC0001.jpg
Volumes/LaCie250GB/Unsorted/to-sort/New Folder_01/01_B-TEC.jpg
Volumes/LaCie250GB/Year_1/B-TEC-001.jpg
- et al...
So far I can easily set colours to FILES which have "B-TEC" in their filename using the standard Sub Folder Rule
- Code: Select all
IF KIND > IS > FOLDER - then - RUN RULES ON FOLDER CONTENTS
then
IF NAME > CONTAINS > B-TEC - then - SET COLOR TO > BLUE
Standard stuff...
However the problems start when I try and set colours further back up the file path. I've been dicking around with the Enclosing/All/Any/Sub/Files or Folders drop down menu but with only limited success as I've not been able to set a colour to any folder higher than the the folder immediately above another file or folder which contains the word "B-TEC".
I currently have the following rules:
RULE 1 - Sub Folder Rule
- Code: Select all
If ALL of the following conditions are met for ANY OF ITS SUB-FILES OR FOLDERS
KIND > IS > FOLDER
Do the following to the matched file or folder:
RUN RULES ON FOLDER CONTENTS
RULE 2 - Colour Folders in File Path That Contains B-TEC Reference
- Code: Select all
If ALL of the following conditions are met for ANY OF ITS SUB-FILES OR FOLDERS
NAME > CONTAINS > B-TEC
Do the following to the matched file or folder:
SET COLOR TO LABEL > BLUE
One thing I don't understand is why the Sub Folder Rule above needs to be be set to "ANY OF ITS SUB-FILES OR FOLDERS" in order to work.
Any ideas on how to do this? I really have tried looking for the answer here in the Hazel forums and in the wider Google-sphere, but most searches only give me instructions about the standard sub folder rule...
How do you write a rule to descend into sub-folders, but then act on folder back up at the top.
Also is there a good tutorial on how the "Enclosing/All/Any/Sub/Files or Folders" drop down menu actually works and how it behaves when "Running Rules On Folder Content"...?
Hope this isn't too much of a brain warp...
Many thanks in advance...