File in subfolder based on filename

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

Moderator: Mr_Noodle

File in subfolder based on filename Sun Nov 16, 2014 4:50 pm • by joshfree
I've read many of the posts about subfolders but can't seem to find the answer to this question. Feel free to link me if there's something already in the forums about it.

I am trying to automatically move folders to the correct subfolder in my Dropbox, based on a job code at the start of each filename.

Each incoming file is named with a 6-character code like this: "ABC123"
There is a subfolder in my folder structure that begins with a corresponding job code.
I want Hazel to read the code, then move the incoming file to the correct folder.

The folder structure looks like this:

Dropbox
- First client
-- ABC101 Description1
-- ABC102 Description2
- Second client
-- DEF101 Description 3
-- DEF102 Description 4

And so on

The file might be named "ABC102 Concept Presentation.pdf" and I want it to end up in the folder "ABC102 Description2".

I hope this make sense. Is this doable?

Thanks from an utter Hazel newbie.
joshfree
 
Posts: 4
Joined: Sun Nov 16, 2014 4:39 pm

Re: File in subfolder based on filename Sun Nov 16, 2014 9:36 pm • by joshfree
These all seem to have parts of the answer.

viewtopic.php?f=4&t=3373
viewtopic.php?f=4&t=2428
viewtopic.php?f=4&t=1698

It appears I can't do what I'm trying to do because the Sort Into Subfolder function of Hazel has no wildcard. So it can't match part of a filename to part of a corresponding folder name. I would have to build a lookup table somehow or perhaps create an Applescript. Which all sounds like more work than just dragging the files with Launchbar which is what I do now. (Especially because I barely know Applescript.)

Can someone confirm these assumptions? Thanks.
joshfree
 
Posts: 4
Joined: Sun Nov 16, 2014 4:39 pm

Re: File in subfolder based on filename Mon Nov 17, 2014 1:50 pm • by Mr_Noodle
That's pretty much the case. You can use the "Replace text" option and put the lookup table in there which will allow you to do it without any scripting.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: File in subfolder based on filename Sat May 16, 2015 9:56 am • by Tylast
Is wildcard pattern matching for the existing names of folders using "sort into subfolders" coming anytime soon? That single feature would very useful.
Tylast
 
Posts: 1
Joined: Sat May 16, 2015 7:44 am

Re: File in subfolder based on filename Mon May 18, 2015 1:39 pm • by Mr_Noodle
It is being considered but not terribly soon (probably something for 4.0).
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support