Moving file to folder based on filename

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

Moderator: Mr_Noodle

Moving file to folder based on filename Mon Sep 05, 2022 5:01 am • by fulvioub
Hi,
I'm really new to using Hazel and can't get my head around this one. I have a shared root folder in which users drop files, named 12345 ABCDEF b, where 12345 is any 5 digit number, ABCDEF is any random string and b indicates this is temporary placement. They may or may not be separated by spaces (e.g. 12345ABCDEFb is also valid. Usually a few minutes after that file is placed in the root folder, a subfolder is automatically created (through a script in my database) called "12345". I'd like to use Hazel to monitor the root folder and automatically place all files with the prefix 12345 (or whatever it is) into the corresponding subfolder once it is created. I'm struggling with using the filename as a variable for placement within a subfolder - is this possible?

Thanks!
fulvioub
 
Posts: 1
Joined: Mon Sep 05, 2022 4:56 am

Re: Moving file to folder based on filename Tue Sep 06, 2022 9:38 am • by Mr_Noodle
Look up "match patterns" in the help. You can create custom attributes to grab parts of the filename which you can re-use in an subsequent pattern, like a Sort into Subfolder action.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron