Newbie: avoiding multiple applications of renaming rule

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

Moderator: Mr_Noodle

Hi --

I'm evaluating Hazel to help auto-organize my photo library from DropBox, and am trying resolve inconsistent behavior I'm seeing, presumably due to misconfiguration on my part.

I would like to rename photo files based on the camera device (if it is present in the file's metadata), and then sort them into year and month subfolders. Since I want to sort all pictures irrespective of whether they have the camera metadata, I have set up two rules using the following logic:

RULE 1
If file is a Picture and its Device Model is not blank
Then rename it to "Name - Device Model Extension"

This should give me e.g.

Code: Select all
2013-02-17 10.13.38 - iPhone 5.jpg

RULE 2
If file is a Picture then
Then Sort into subfolder with pattern Year
Then Sort into subfolder with pattern Year-Month-Date

This gives me e.g.

Code: Select all
2013/
  2013-02-20/
  2013-02-23/
  ... etc ...

I am having trouble getting these to work together reliably. In particular, sometimes the first rule seems to be applied multiple times in succession, and the second rule skipped. This leaves me with JPGs that look like this

Code: Select all
2013-02-17 10.13.38 - iPhone 5 - iPhone 5.jpg

or sometimes

Code: Select all
2013-02-17 10.13.38 - iPhone 5 - iPhone 5 - iPhone 5.jpg

at the root level of the folder (i.e. not sorted into subfolders).

I thought this might be because the renamed file is treated like a completely new file (vs just renamed) that Hazel again recognizes and starts processing anew. However if this were the case, wouldn't Hazel just keep doing this forever? Is there some sort of limit that stops it from recursing infinitely? If so, why does it sometimes happen 2 times and sometimes 3?

And most importantly :-) how do I avoid it? Is there a way to mark a file as "already processed by rule X so please don't process it again"?

Thanks in advance for your help.

Ramon
felciano
 
Posts: 30
Joined: Sat Feb 23, 2013 5:44 pm

Your presumption is correct - the first rule matches the files because, quite frankly, the condition is still true (e.g. the file is still a picture and it still has a non-blank device model). Accordingly, your second rule will not move your pictures.

And yes, Hazel will continue to match the file ad infinitum, limited only by a short delay between matching the same rule.

I suggest that you modify your rules like this:

Rule 1: Rename & Sort Photos with Device Metadata

Code: Select all
if (all) of the following conditions are met for (the file or folder being processed):
     kind is picture
     device model is not blank
     name does not match (anything) - (anything)

Do the following to the matched file or folder:
     rename with pattern (name) - Device Model Extension
     sort into subfolder year/year-month-date


Rule 2: Rename & Sort all other photos

Code: Select all
if (all) of the following conditions are met for (the file or folder being processed):
     kind is picture

Do the following to the matched file or folder:
     sort into subfolder year/year-month-date


I added the name exclusion in Rule 1 so that if you move your files again, they won't be named twice.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Thanks a_freyer -- works beautifully now!

Ramon
felciano
 
Posts: 30
Joined: Sat Feb 23, 2013 5:44 pm


Return to Support