Page 1 of 1

Delete JPG with same name as RAW files

PostPosted: Wed Aug 26, 2020 9:48 pm
by Valet37
Hello, I've scoured the forums and can't figure out how to do this. I have a folder that contains both .JPG and .DNG (.dng is a RAW image format). Some of the files are identical images saved in both JPG and DNG formats these photos are named identically other than the file extension. For example:

However, sometimes when I shoot panoramas I do not get a .DNG file and only end up with a .JPG file.

    DJI_0001.DNG and DJI_0001.JPG are the same photo in different formats.
    DJI_0002.JPG is a panorama
    DJI_0003.DNG and DJI_0003.JPG are the same photo again

I'm trying to create an automation that scours my folder looking for all instances where the .JPG and .DNG files have the same name, and then delete the .JPG. So the desired result in the example above is to delete DJI_0001.JPG and DJI_0003.JPG and leave the rest.

Can anyone help?

Re: Delete JPG with same name as RAW files

PostPosted: Thu Aug 27, 2020 10:37 am
by Mr_Noodle
You can use nested conditions (look them up in the manual) like so:
Code: Select all
   If (all) are met
       Name matches (•file name)
       Extension is JPG
          If (all) are met for (any file in the same folder)
              Name matches (•file name)
              Extension is DNG
   Do
       Move to Trash

(•file name) is a custom attribute which matches "anything". The first match will grab the file's name and store it into that custom attribute. The second match will require that the name matches the already captured value.

I suggest trying it on a test folder until you are confident that it is working as desired.

Re: Delete JPG with same name as RAW files

PostPosted: Thu Aug 27, 2020 7:49 pm
by Valet37
Worked perfectly, thank you! It's going to take me a while to get used to the logic tree.