Process rule only when metadata file does not exist

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

Moderator: Mr_Noodle

This is most likely an edge case, but say I have thousands of images in raw format, some with metadata files structured like so:


I want to run a rule with multiple conditions, one being the *absence* of the .xmp metadata file. Is there a good way within the Hazel rule set to check this? Thanks for your help and for an awesome app!
Posts: 2
Joined: Tue Jun 25, 2019 9:40 am

You can use a nested condition (check the help on that). Using that, you can do something like:
Code: Select all
If (all) are met
    Name matches (•file name)
    Extension is nef
    If (none) are met for (all files in the same folder)
        If (all) are met for the current file
            Extension is xmp
            Name matches (•file name)

Where (•file name) is a custom attribute matching "anything" (see "match patterns" in the help). That should match a nef file with no corresponding xmp. I believe the double-nested conditions is necessary because you are testing for the absence of such a file.
Site Admin
Posts: 8697
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Awesome! I’ll give this a try. Thank you for the help!
Posts: 2
Joined: Tue Jun 25, 2019 9:40 am

Return to Support