Page 1 of 1

Sorting Files with Similar Names

PostPosted: Tue Mar 25, 2025 4:54 pm
by Pianomanross
I'm trying to use Hazel to help sort files in a directory based on common words in their filenames. For instance, I want any file that shares two or more words in sequence to be moved to a subfolder that is titled by the shared sequence of their name. So if I have file 1="David goes to camp" and file 2="David goes to school", then it would move both files into a subfolder called David goes to (since those are the common words in sequence of the their respective filenames). ChatGPT and Claude have been helping me build an AppleScript, but so far the results have been hit or miss. Anyone have any thoughts? Thanks.

Re: Sorting Files with Similar Names

PostPosted: Wed Mar 26, 2025 9:02 am
by Mr_Noodle
That's very specialized logic and possibly very resource intensive. For instance, what if you have a file called "David goes". Do all three files go to "David goes" or do the two original files still go to "David goes to". Basically, this seems like a problem that is more algorithmic and outside of any Hazel specific issues.

Re: Sorting Files with Similar Names

PostPosted: Wed Mar 26, 2025 1:23 pm
by Pianomanross
That's what I figured, but thought I'd ask. Thanks for the quick reply. :)