Sorting Files with Similar Names

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Sorting Files with Similar Names 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.
Pianomanross
 
Posts: 4
Joined: Wed Feb 24, 2021 12:22 pm

Re: Sorting Files with Similar Names 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.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Sorting Files with Similar Names Wed Mar 26, 2025 1:23 pm • by Pianomanross
That's what I figured, but thought I'd ask. Thanks for the quick reply. :)
Pianomanross
 
Posts: 4
Joined: Wed Feb 24, 2021 12:22 pm


Return to Support