Page 1 of 1

Parse file name and match with folder?

PostPosted: Tue Dec 06, 2016 3:18 am
by miyixinsun
I regularly download images from DeviantArt and would like Hazel to sort them for me automatically.

For example,

forest_owl_by_secretdartiste-daka9cz.png

The formula for DeviantArt's images is always:
filename_by_USERNAME-extrastuff

That is, the USERNAME is always preceded by a by_ and ends after -

I would like Hazel to identify the username based on the file name, traverse my directory for the matching folder, and move it there. If there is no matching folder, then have Hazel create a new one.

I realize this might be a bit complicated but I've heard good things about Hazel.

Thank you in advance.

Re: Parse file name and match with folder?

PostPosted: Tue Dec 06, 2016 12:24 pm
by Mr_Noodle
Search for "match patterns" in the help. The sort into subfolder action should handle the actual sorting part.

Re: Parse file name and match with folder?

PostPosted: Tue Dec 06, 2016 1:37 pm
by miyixinsun
Mr_Noodle wrote:Search for "match patterns" in the help. The sort into subfolder action should handle the actual sorting part.


Hi Mr Noodle, I just tried it and it worked like a charm. Thank you so much!