Page 1 of 1

Counting files with same name and different ext and tag

PostPosted: Sun Jul 05, 2020 10:31 am
by Mikael
Hi

I have a folder with a lot of files and I'm looking for a way to count them and if there are 3 of the same file name I want to tag them with a colour. I want to find the ones that only have 1 or 2 without doing it manually more than sort the an see the ones that doesn't have a color. Is that possible with Hazel? Even better would be to find the files that only have 1 or 2 files with the same name. Then I can sort manually for those colours.

I only want to tag the files below with aa since they are 3 with the same name. aa and the other name is only an example and the name before the extension could be anything.

aa.pdf
aa.mp3
aa.wav

bb.pdf
bb.mp3

cc.pdf
cc.wav

dd.mp3
dd.wav

I tried a nested folder but that didn't work... All the extension didn't match which seems strange since the folder contains a pdf, mp3 and wav file.

If all of the following are met
Name matches file name (anything)
Extension is .pdf

If all of the following are met for file or folder in the same folder
Name matches file name (anything)
Extension is .mp3
Name matches file name (anything)
Extension is .wav

Grateful for any input.

Re: Counting files with same name and different ext and tag

PostPosted: Mon Jul 06, 2020 10:41 am
by Mr_Noodle
You are pretty close. In your nested condition, it won't work, as a single file will never have both a mp3 and wav extension. Instead you need to split those:
Code: Select all
If (all) are met for (the current file)
    If (all) are met for (file in same folder)
        Name matches filename (anything)
        Extension is mp3
    If (all) are met for (file in same folder)
        Name matches filename (anything)
        Extension is wav

Give that a try and report back if you still have problems with it.