Page 2 of 2

Re: Tip: Create an empty folder structure with Automator

PostPosted: Mon Dec 02, 2019 3:11 pm
by gcoghill
Mr_Noodle wrote:I think the point here is that sometimes people want to create the folders without having a file to put into them. They want to create all of them up front for future use.

Yes this tip was about populating a folder with empty subfolders. I just renamed the original post title and intro text to be more clear about that aspect.

Re: Tip: Create an empty folder structure with Automator

PostPosted: Sat Jan 25, 2020 6:56 pm
by Trickyt57
I think you could do it my way by using a dummy file to populate each newly created folder, and just another rule to delete the dummy files.

Re: Tip: Create a specific folder structure with Automator

PostPosted: Wed Jan 06, 2021 4:44 pm
by hal
Mr_Noodle wrote:I think the point here is that sometimes people want to create the folders without having a file to put into them. They want to create all of them up front for future use.



For posterity's sake, here's a way to do it within Hazel:

Use "Run shell script" action. Create an embedded script that uses the mkdir command:

mkdir $1/subfolder1
mkdir $1/subfolder2
mkdir $1/subfolder3
mkdir $1/subfolder4
...

mkdir creates a new empty folder (make directory)
$1 is the variable for the folder being evaluated
"subfolder1" can be replaced with whatever name you want the new subfolder to be
Repeat for as many new subfolders as you need.

Re: Tip: Create an empty folder structure with Automator

PostPosted: Thu Jan 07, 2021 12:25 pm
by gcoghill
Awesome, this is even more ideal.

I had zero shell scripting experience when I created this initially, and even now just barely starting to learn, but yeah this makes way more sense.