Page 1 of 1

Delete Specific Files in a Folder

PostPosted: Sat Aug 22, 2020 9:48 pm
by cohnhead
Hi. I am working with comic book files that I have setup a hazel rule to unzip. When I unzip, it creates a folder with the following format:

In each folder, there is a subfolder. In each subfolder, there are a lot of jpg files.

What I want to do is delete the first jpg file in this subfolder (the one that is sorted first alphabetically), and no more. I could even rename it so it doesn't sit first in the folder, but I cannot figure out a way to do this.

Does anyone have any ideas?

Re: Delete Specific Files in a Folder

PostPosted: Mon Aug 24, 2020 10:34 am
by Mr_Noodle
There's no good way using the built-in conditions. You'd probably need to write a script to determine the first one alphabetically. You can then use that as a Apple/Java/shell-script condition in your rule.