Creating SubFolders in Same Folder

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

Moderator: Mr_Noodle

Creating SubFolders in Same Folder Thu Oct 28, 2010 5:17 am • by WilliamThirteen
Hi all,
I am new to Hazel (attracted by what i heard on the MacPowerUsers podcast) and hope to simplify my workflow. However, my first use case has me baffled. I have searched around the forum but haven't found a solution yet. I would like to implement the following rule in Hazel.

if a folder named "xyz" is present

then rename the folder to "xyz_32bit"

and (in the same location)

create a new folder named "xyz_64bit"

my first attempts have failed as i keep running up against the limitation that i can't copy the folder and then rename it. I have also tried using the "sourcefolder" option, but unfortunately I cannot select upon which folder to run the action as it doesn't exist until i create it.

any ideas are welcome!

thanks in advance,
William
WilliamThirteen
 
Posts: 3
Joined: Thu Oct 28, 2010 4:43 am

Re: Creating SubFolders in Same Folder Thu Oct 28, 2010 12:11 pm • by Mr_Noodle
I'm a bit unclear on what you are trying to do. You want to take a folder, rename it and then copy it and rename it again? If so, it should work except that you may have to copy the folder to another location, rename it and move it back.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Creating SubFolders in Same Folder Thu Oct 28, 2010 12:26 pm • by WilliamThirteen
yes, sorry, i was in the middle of fiddling with it and was still thinking about the process. Essentially when i create a folder named 'xyz' i would like Hazel to see this and create two folders, one named xyz_32 bit and the second xyz_64bit. Of course, now that you've mentioned copying it to another directory, then renaming it and copying it back - i think you've provided the hint i needed.

In the meantime I've already found a number of other uses for Hazel. This is quite a flexible Swiss Army Knife you've created!

thanks & I will let you know how it goes once i try out your suggestion.

William
WilliamThirteen
 
Posts: 3
Joined: Thu Oct 28, 2010 4:43 am

Hi, I've made progress but am now running into a curious issue regarding renaming files:

my rule states 'if kind is folder' rename to (name)32bit. The rule runs correctly but truncates the folder name when the name ends with a ".x". So that

folder.1.2.3

is renamed to

folder.1.232bit

i suspect Hazel feels the trailing .x is an extension and not part of the folder name, is that correct?

thanks,
William
WilliamThirteen
 
Posts: 3
Joined: Thu Oct 28, 2010 4:43 am

Re: Creating SubFolders in Same Folder Fri Oct 29, 2010 2:31 pm • by Mr_Noodle
Yes, it's interpreting that as an extension. Try including the extension attribute in the rename pattern.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support