Page 1 of 1

Feature request: add a variable for target folder name

PostPosted: Tue Jun 01, 2021 10:04 am
by paulhubert
What I would LIKE to do is move files to a subfolder based on the creation date of the file.
Primary folder names would be yyyy.
subfolders would be 01-12 but preferably with the spelled-out month as part of the name.
So, 01 January, 02 February, 03 March, etc.
This would appear to also require an array to accomplish easily.
It could be even more powerful if subfolders, if they do not already exist, could be created,
although that is a MINOR issue!
AS I envision it, it would be necessary to SET the variable name USING the date created.
Exactly HOW this would work as Hazel currently creates rules, I'm not sure.
Since the target folder is a FIXED item during rule creation (navigate to and open)
I don't see how this could be implemented dynamically.
If, during rule creation, the parent folder could be 'opened' into a variable and the target folder
dynamically specified as <parentvar>'>'<subvar> and THEN opened for the move...??
OK. I WAS a programmer. I suppose I'm just being annoying!
If so, my apology!!! :-(

Re: Feature request: add a variable for target folder name

PostPosted: Tue Jun 01, 2021 10:11 am
by paulhubert
OK, it may get squirrleier (to coin a word?) - another approach would be to
add the ability to CHAIN rules -
That is, to RUN a sub-rule from within a rule.
If date-created (date format edited) is yyyy01 run subrule <name>
Eliminates the need for the array or dealing with variable filenames.

Re: Feature request: add a variable for target folder name

PostPosted: Tue Jun 01, 2021 10:13 am
by paulhubert
Oops. Omitted this:
Clearly such sub-rules would never be executed automatically.

Re: Feature request: add a variable for target folder name

PostPosted: Wed Jun 02, 2021 9:51 am
by Mr_Noodle
Have you tried the "Sort into subfolder" action with "date created" as the pattern? After adding the date created, you can click on it to edit its format to only show the year and month.