Folder creation on day of week with numbering

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Hey all,

So I've got a project that I do weekly. Each project gets it's own folder (Episode 081 currently - it's a podcast if anyone is wondering) and within those folders I have an Apple script that makes the required sub folders. It's tidy, but it would be great if next Thursday (every Thursday in fact) it created the next folder in the sequence - in this case, "Episode 082".

Making folders isn't hard, quick Apple Script and done. Hazel has a time function now, so that seems taken care of. The only thing I can't really figure out is how to get Hazel to sequentially make folders each week. I mean, something like $i = 081, Every Thursday make folder i, i++; is surely possible?

Thoughts?
Thanks!
Flynntargart
 
Posts: 27
Joined: Mon Mar 29, 2010 12:07 pm

For the scheduling part, you can use the Current Time attribute. If these folders stay put in the main folder, you can try using the "#" (counter) attribute. Since you didn't start out by using it, it will end up filling in any gaps in the sequence until it catches up, though.
Mr_Noodle
Site Admin
 
Posts: 11235
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hey Mr. Noodle,

So... this isn't working very well so far... so...

1. Feature Request: Create Folder action (with naming variables like the rename function) that can place a folder anywhere, not just inside the checked folder.

2. The problem...

We do a podcast each week and we create a bunch of AIFF audio files. From there it would be great to sort them into sequentially named subfolders, which sounds like it shouldn't be a problem, except...

If the file name is "Ep082 - 080 - Bye - T4 - Jenn - 20160527- 2151.aiff"

I can have Hazel create a Folder with almost the correct name with the Sort into Subfolders function. I have it make a folder and rename the folder with the pattern Replace "Ep" with "Episode ". Which gets me half way there, but then there's the rest of the junk in the file name which gets tacked on... is there a way just to leave the folder as "Episode 082"? From there the aiff file is dumped into a sub-folder called "RAW" which hazel makes in the same subfolder step, so the full desired path would be "Episode 082/RAW/Ep082 - 080 - Bye - T4 - Jenn - 20160527- 2151.aiff" but the actual path winds up being "Episode 082 - Bye - T4 - Jenn - 20160527- 2151/RAW/Ep082 - 080 - Bye - T4 - Jenn - 20160527- 2151.aiff"

So I wind up with a jumbled kind of folder name.

I also tried to have it make a folder with a quick Applescript them rename the folder based on your sequence suggestion, but I can't seem to get it going - the applescript dumps the new "Episode 000" into the existing Episode XXX folder. Code:
Code: Select all
tell application "Finder"

if (exists folder "Episode 000" of theFile) is false then
make new folder at theFile with properties {name:"Episode 000"}
end if

end tell


So I wind up with "Episodes/Episode 001/Episode 000" and "Episodes/Episode 002/Episode 000" etc all the way to current (82). So if I could get the script to make the folder inside Episodes (the folder the rules are all running on) then I could have a rule renaming any folder called "Episode 000" to "Episode ###" where # is the sequence eh?

Really, what I'd like to have happen each week before recording (withe the time function, thanks for that btw) is:
Each Thursday at 10pm create folder "Episode ###" (where "###" is the next episode/next folder in the sequence, in this case, 083" then run a rule to create the required subfolders (already works, it's an action script that creates 6 folders, RAW, Imported, Sound Effects, Etc).

Sorry this has been long winded but this has been kind of a hassle for what seems like it should be a simple process :S
Flynntargart
 
Posts: 27
Joined: Mon Mar 29, 2010 12:07 pm

Search the help for "match patterns". There you can isolate parts of the name for reuse later.
Mr_Noodle
Site Admin
 
Posts: 11235
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion