Need Help Creating Subfolder Rule

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

Moderator: Mr_Noodle

Need Help Creating Subfolder Rule Mon Jun 04, 2012 4:00 pm • by MBrandhorst
New to Hazel.
I have a folder on an external drive where I create and store client folders.
Every time I create a new client folder I need to create the same three subfolders for that new client folder.
Been trying to set up a rule to do this automatically when I create the new client folder and I can seem to get it.
Can anyone help?
MBrandhorst
 
Posts: 2
Joined: Mon Jun 04, 2012 3:55 pm

Re: Need Help Creating Subfolder Rule Mon Jun 04, 2012 4:42 pm • by Mr_Noodle
You'll probably need to do a script to create the folders. While there is a Sort into Subfolder action which will create folders, it ends up moving the file/folder in question into that newly created folder. Instead, you need to write a script to create empty folders for you.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Need Help Creating Subfolder Rule Mon Jun 04, 2012 5:43 pm • by MBrandhorst
Mr_Noodle wrote:You'll probably need to do a script to create the folders. While there is a Sort into Subfolder action which will create folders, it ends up moving the file/folder in question into that newly created folder. Instead, you need to write a script to create empty folders for you.


I was able to create one empty subfolder, but can't figure out how to make three empty subfolders with different names at the same level.

My current rule looks like:
...Do the following
Run rules on folder contents
Sort into subfolder, with pattern: name ▸ Proposals
MBrandhorst
 
Posts: 2
Joined: Mon Jun 04, 2012 3:55 pm

Re: Need Help Creating Subfolder Rule Tue Jun 05, 2012 5:32 am • by Pe8er
Try Applescript. This should get you started:

Code: Select all
set path_ to choose folder
set folders_ to {"folder 1", "folder 2"} -- names of folders you want to create

repeat with folder_ in folders_
   tell application "Finder" to make new folder at path_ with properties {name:folder_}
end repeat
Pe8er
 
Posts: 21
Joined: Sun Nov 06, 2011 12:52 pm


Return to Support