Create a new folder and move files there on a specific day

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

Moderator: Mr_Noodle

Greetings,
I have a Present Bills folder where I store some files along the year.
This Present Bills folder lies on a more generic Bills folder, where I store all of my bills in subfolder, each subfolder is a year (2020, 2021, ...).

My goal for this rule is:
1) at the end of the year, a new folder is created under the Bills folder. Name of the folder: the present year
2) all the files under the Present Bills folder are moved into the new folder

A real scenario:
1) at the end of this year, the "2023" folder is created under the Bills folder
2) all the files under the Present Bills folder are moved to the 2023 folder

I'd like to automate all of this for the future years.

Is it possible with Hazel? How?
I may even split into 2 rules: create the new folder on 30th December with one rule, and move the files on 31th December with another rule.
I've tried, but can't see kind of "Create new folder" option.
IvanPsy
 
Posts: 26
Joined: Thu Jul 14, 2022 3:38 am

Match each of the files you want to move and use Sort into subfolder. That will create the folder as necessary.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Match each of the files you want to move and use Sort into subfolder. That will create the folder as necessary.


I'm sorry I don't understand how to use the Sort option.

How do I tell Hazel to move the files into a folder that doesn't exist yet?
If I check under the "Move" action, Hazel lets me choose only from already existing folders.

Can you please give me a feedback ab out the rule I post here as screenshots?

https://imgur.com/a/m0nqiHY

Another question: where do I put the rule?
Inside the Bills folder (that is the parent folder), or inside the Present Bills folder?
IvanPsy
 
Posts: 26
Joined: Thu Jul 14, 2022 3:38 am

Sort into subfolder creates the folder if it doesn't exist. The rule should be for the folder where the files you want to process reside. If you want the subfolders to be under a different folder, then you need to do a move to that folder, then sort.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Sort into subfolder creates the folder if it doesn't exist. The rule should be for the folder where the files you want to process reside. If you want the subfolders to be under a different folder, then you need to do a move to that folder, then sort.


Can you please check the screenshot?

https://imgur.com/a/4G7kV9G

Conditions:
    At 10pm of 31st December
    Any File into the folder

Actions:
    Set into subfolder with the current date (only the year)

How do I add the Move action?
If I add the action NOW, it asks me to choose a folder that already exists.
IvanPsy
 
Posts: 26
Joined: Thu Jul 14, 2022 3:38 am

Your subfolders all exist under a common folder, right? Set the move to move it to that folder.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Your subfolders all exist under a common folder, right? Set the move to move it to that folder.


Maybe a screenshot makes things clearer: it's difficult to explain by words.

This is the situation: https://imgur.com/a/Hatv1Qe . I'm sorry it's in Italian, not English.

The bills of this year are under "@Acquisti attuali".
My goal for the rule:
- On 31st December, the rule create a new folder "2023"
- Then all the files under @Acquisti attuali are moved to 2023

So the 2023 folder doesn't exist yet, as it will be created at the end of the year.
I may create the 2023 folder by hand before the end of the year, but I'd like to have a dynamic rule that work for all the years I the future automatically.

I may also create two rules:
- one that creates the 2023 folder
- one that move the files inside @Acquisti attuali to 2023

But again: now that I'm creating the rule, the 2023 folder doesn't exist yet, so: how do I tell Hazel to move the files to that folder?

Hope it makes sense.
IvanPsy
 
Posts: 26
Joined: Thu Jul 14, 2022 3:38 am

You do not need a separate "create folder" step. As I mentioned, Sort into subfolder will create it as necessary.

The steps you need to do (in a single rule):
- Move to the @Acquisti folder (I assume this is the folder shown in your screenshot that contains all the other folders
- Sort into subfolder based on the year. Make sure the date format only includes the year part.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:You do not need a separate "create folder" step. As I mentioned, Sort into subfolder will create it as necessary.

The steps you need to do (in a single rule):
- Move to the @Acquisti folder (I assume this is the folder shown in your screenshot that contains all the other folders
- Sort into subfolder based on the year. Make sure the date format only includes the year part.


Can you please check that I'm doing it right?
https://imgur.com/kODARGf

Sidenote: I'd like some tutorials to learn such advanced use of Hazel, as I see I'm using it only at 10% of its potential.
IvanPsy
 
Posts: 26
Joined: Thu Jul 14, 2022 3:38 am

Seems ok to me though I can't see how you formatted the "current date" attribute. How does it actually run?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Seems ok to me though I can't see how you formatted the "current date" attribute. How does it actually run?


It's set as Year: https://imgur.com/vMfsSdW
IvanPsy
 
Posts: 26
Joined: Thu Jul 14, 2022 3:38 am

It looks fine. Have you actually run it?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:It looks fine. Have you actually run it?


Indeed it works.
Thank you for your support.
I've tested the rule on a Temp folder with just one file, and it worked.
Now I wait for December 31st for the main show to happen ;-)
IvanPsy
 
Posts: 26
Joined: Thu Jul 14, 2022 3:38 am


Return to Support