partial matches of name and existing subfolder?

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

Moderator: Mr_Noodle

partial matches of name and existing subfolder? Mon Aug 08, 2016 3:42 am • by MiB
Is there some native way of matching a file where only a partial is the same as a string in an existing subfolder that the file is sorted into, instead of Hazel creating a new one?

I have an existing subfolder structure with hundreds of folders of unique serial numbers. In the parent folder an external process is adding files and the file names also contain the same serial numbers. What I need is to match up the file with serial number as xxxxx: "Lots-of-variable-text(xxxxx)" with an existing folder: "Project-xxxxx-Lots-of--other-variable-text". Seems like something very typical to be able to do.

I'm thinking there might be a simple way to at least get the serial out of the file and folder names — which are partial strings — and match them with applescript, but maybe there's even an existing native way to do partial matches?
MiB
 
Posts: 11
Joined: Fri Nov 28, 2014 3:54 am

Provided you are running a recent version of Hazel, in the Sort into subfolder action, there's an "anything" token which you can use. So, if you set up a custom attribute to capture the partial string, then you can then re-use that in the Sort into subfolder pattern. For the parts outside of the custom attribute, you use the "anything" token. That will match an existing folder with that partial string.
Mr_Noodle
Site Admin
 
Posts: 11951
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Provided you are running a recent version of Hazel, in the Sort into subfolder action, there's an "anything" token which you can use. So, if you set up a custom attribute to capture the partial string, then you can then re-use that in the Sort into subfolder pattern. For the parts outside of the custom attribute, you use the "anything" token. That will match an existing folder with that partial string.


I assume you mean version 4? If so, time to upgrade.
MiB
 
Posts: 11
Joined: Fri Nov 28, 2014 3:54 am

Yes, sorry. Should have been more specific. I suggest running it in trial mode first so you can make sure it's what you want before purchasing the upgrade.
Mr_Noodle
Site Admin
 
Posts: 11951
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support