Keeping the newest version of file based on filename

Hi all
Been doing some digging around, and I've found some posts that seem to suggest I could do what I'm asking, but I can't seem to modify the previous solutions to do what I want (I've never been an AppleScripter, so the best I can do there is copy/paste unfortunately). I was wondering if someone might be able to help, or even link me to a missed post that gives me the info I'm looking for.
I would like Hazel to go through my dmg/pkg files and find delete the older versions of files based on the filename (same filename just gets overwritten if I download it). So for example, "LittleSnitch-3.6.dmg" and "LittleSnitch-3.7-nightly-(4710).dmg", in this case I'd like to delete the 3.6 file.
Any thoughts or links would be greatly appreciated.
Cheers.
Been doing some digging around, and I've found some posts that seem to suggest I could do what I'm asking, but I can't seem to modify the previous solutions to do what I want (I've never been an AppleScripter, so the best I can do there is copy/paste unfortunately). I was wondering if someone might be able to help, or even link me to a missed post that gives me the info I'm looking for.
I would like Hazel to go through my dmg/pkg files and find delete the older versions of files based on the filename (same filename just gets overwritten if I download it). So for example, "LittleSnitch-3.6.dmg" and "LittleSnitch-3.7-nightly-(4710).dmg", in this case I'd like to delete the 3.6 file.
Any thoughts or links would be greatly appreciated.
Cheers.